-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Flávio da Maia Jr edited this page Jun 29, 2022
·
2 revisions
It's possible to add using .NET CLI or Package Manager.
dotnet add package Mailtrap
PM> Install-Package Mailtrap
Check other alternatives on NuGet.org
Before starting your tests using Mailtrap you need to create an account on Mailtrap.io
using Mailtrap.Source.Models;
var mailtrap = new MailtrapSender("your username", "your password");
var email = new Email(
"to@mailtrap.io",
"from@mailtrap.io",
"Sending e-mail test using Mailtrap for .NET 📬",
"Ahoooy! It really works! 😎");
mailtrap.Send(email);
using Mailtrap.Source.Models;
var mailtrap = new MailtrapSender("your username", "your password");
var body = "<html>" +
"<head>" +
"<title>Mailtrap for .NET</title>" +
"</head>" +
"<body>" +
"<h1>Ahoooy!</h1>" +
"<p>It really works using HTML templates as well! 😎<p>" +
"<p>Unleash your creativity<p>" +
"</body>" +
"</html>";
var email = new Email(
"to@mailtrap.io",
"from@mailtrap.io",
"Sending e-mail test using Mailtrap for .NET 📬",
body,
isBodyHtml: true);
mailtrap.Send(email);