Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 782 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 782 Bytes

SmtpClient

A simple but effective SMTP client for ASP.NET core

Usage

MailMessageBuilder mailMessageBuilder = new MailMessageBuilder()
  .SetSender("[email protected]", "My domain")
  .AddRecipient("[email protected]", "John Smith") // Default recipient type is To (but can also be CC or Bcc)
  .SetSubject("Please confirm your account")
  .SetBody(@"<b>Please</b> click on the following <a href=""www.mydomain.com"">link</a> to confirm your account.", true) // Specifies HTML format
  .AddAttachment("Invoice.pdf", System.IO.File.ReadAllBytes(@"C:\Invoice.pdf"));
  
using (var client = new SmtpClient("localhost", 25))
{
  await client.SendAsync(mailMessageBuilder.build());
}
  

License

This project is licensed under the terms of the MIT license.