The VersaTul Mailer project provides the functionality to send emails messages. This project uses the SMTP protocol to transmit e-mail to a mail receiver.
$ dotnet add package VersaTul.MailerVersaTul Mailer is a project that provides the functionality to send email messages using the SMTP protocol.
To install VersaTul Mailer, you can from NuGet using the following command:
PM> NuGet\Install-Package VersaTul.Mailer -Version latest
To use VersaTul Mailer, you need to create an instance of the MailDispatcher class and pass it an IMailConfiguration and an ISmtpClient. Then, you can call the SendMail method to send an email message.
For example:
// Create a mail configuration
IMailConfiguration mailConfig = new MailConfiguration();
mailConfig.From = "sender@example.com";
mailConfig.To = "receiver@example.com";
mailConfig.Subject = "Test email";
mailConfig.Body = "Hello, this is a test email.";
mailConfig.IsBodyHtml = false;
// Create an SMTP client
ISmtpClient smtpClient = new SmtpClientWrapper();
smtpClient.Host = "smtp.example.com";
smtpClient.Port = 25;
smtpClient.EnableSsl = true;
smtpClient.Credentials = new NetworkCredential("username", "password");
// Create a mail dispatcher
IMailDispatcher mailDispatcher = new MailDispatcher(mailConfig, smtpClient);
// Send the email
mailDispatcher.SendMail();
You can configure various settings for the mailing application by modifying the app.config file or passing a custom configuration file to the MailConfiguration constructor.
The configuration settings include:
See Configuration Defaults for more information.
VersaTul Mailer is licensed under the MIT License. See LICENSE for more details.