Skip to content

A simple but effective SMTP client for ASP.NET core

License

Notifications You must be signed in to change notification settings

aleripe/SmtpClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple but effective SMTP client for ASP.NET core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages