简体   繁体   中英

How do I send e-mail using .NET 4 if smtp server requires authorization?

如果smtp服务器需要授权,如何使用.NET 4发送电子邮件?

Pass credentials to the Smtp Server variable

smtpServerInstance.Credentials = new NetworkCredential("user", "password"); 
smtpServerInstance.Send(mail);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM