-
Notifications
You must be signed in to change notification settings - Fork 0
The .NET System Mail Sender
Don't want to configure a bunch of mail settings just to send a few system e-mails? No problem! Use onehop to send e-mails directly from your client to the mail host.
- Make sure you have an IP in good reputation, and your IP has a PTR record (best if it matches the A record).
- Make sure you KEEP your IP in good reputation. Onehop uses only legitimate techniques to help you send e-mail to willing recipients, it will not help you send spam.
Onehop is dead simple to use.
You'll need one of these:
using LazyRabbit;
And one of these:
var mailer = new OnehopMail();
Call this for each time you want to send mail:
mailer.Send(
MailMessage message, // .NET mail message you want to send
Action<Exception> callbackException = null, // any exceptions that were thrown, see Excepetions.cs
Action<MessageHostSender> sendCallback = null); // called on successful send
Call this to clean up the queue and stop all mail sending:
mailer.EndAllRetries();
Onehop's retry queue is currently not persistent (if the application crashes or EndAllRetries() is called, mail waiting to be sent in the retry queue will be discarded). This is definitely the next thing I am going to add.