开发者

how to send email via smartermail?

开发者 https://www.devze.com 2022-12-21 15:42 出处:网络
What is smarterm开发者_如何学编程ail? How can i send mail via smartermail installed on server?

What is smarterm开发者_如何学编程ail? How can i send mail via smartermail installed on server? Any smtp settings in web.config?


SmarterMail is an SMTP mail server, so you could use the SmtpClient class to send mail:

var client = new SmtpClient("hostnameOfYourSmtpServer");
var from = new MailAddress("from@example.com");
var to = new MailAddress("to@example.com");
var message = new MailMessage(from, to);
message.Subject = "test subject";
message.Body = "This is a test e-mail message sent by an application. ";
client.Send(message);
0

精彩评论

暂无评论...
验证码 换一张
取 消