An email sender library for DNXCORE50 / DNX451
For DI:
services.AddSmtpEmailSender(server, port, senderName, email, username, password, ssl);
...
var mail = services.GetRequiredService<IEMailSender>();
mail.SendEmailAsync("[email protected]","Title", "<html><head><meta http-equiv=\"Content-type\" content=\"text/html;charset=utf-8\"/></head><body>Html</body></html>").Wait();
For Common:
using CodeComb.Net.EmailSender;
...
var mail = new SmtpEmailSender("smtp.qq.com", 25, "Code Comb", "[email protected]", "YourQQNumber", "YourPassword");
mail.SendEmailAsync("[email protected]","关于MailSender项目说明", "<html><head><meta http-equiv=\"Content-type\" content=\"text/html;charset=utf-8\"/></head><body>能收到邮件吗</body></html>").Wait();