Yahoo Smtp邮件设置配置

时间:2010-07-19 20:17:24

标签: asp.net smtp yahoo

有谁知道web.config文件中需要什么smtp邮件配置设置才能通过ASP中的表单发送外发邮件?感谢。

3 个答案:

答案 0 :(得分:1)

点击此链接:Yahoo POP3 and SMTP Settings

我的猜测是以下内容应该适用于您的代码(不完全确定凭据,因为我没有要测试的帐户):

MailMessage mail = new MailMessage();  
mail.From = new MailAddress("fromname@somewhere.com");  
mail.To.Add("toname@somewhereelse.com");  
mail.Subject = "The Subject";  
mail.Body = "Body text here";  
mail.IsBodyHtml = true;  
mail.Priority = MailPriority.High;  
SmtpClient smtp = new SmtpClient("smtp.mail.yahoo.com");  
smtp.Port = 465;  // this could be 587, not sure
smtp.Credentials = new NetworkCredential("YourYahooId", "YourYahooPassword");  
smtp.EnableSsl = true;  // SSL is required I think
smtp.Send(mail);  

关键是确保使用SSL并发送身份验证凭据。我不认为您只能使用web.config邮件设置来执行SSL。有关详细信息,请参阅this question

答案 1 :(得分:0)

请参阅How to utilize Google gmail server in your.NET Web & Windows Applications文章。那段代码对我有用。如果它不适合您,请发送邮件给我(pandiansaamy@gmail.com)

答案 2 :(得分:0)

SMTP_SERVER = "smtp.mail.yahoo.com"
SMTP_PORT = 587
SMTP_USERNAME = "username" // username@yahoo.com
SMTP_PASSWORD = "password"