0

我正在使用 Visual Studio 2010 Ultimate 开发一个 ASP.NET 网站。我想使用我的雅虎邮件帐户向客户发送确认邮件。我该怎么做?我应该更改或添加哪些设置?

4

3 回答 3

1

这是雅虎邮件设置

  • 雅虎!邮件 SMTP 服务器地址:smtp.mail.yahoo.com
  • 雅虎!邮件 SMTP 用户名:您的完整 Yahoo! 邮件电子邮件地址(包括“@yahoo.com”)
  • 雅虎!邮件 SMTP 密码:您的 Yahoo! 邮件密码
  • 雅虎!邮件 SMTP 端口:465
  • 雅虎!需要邮件 SMTP TLS/SSL:是

这是使用雅虎邮件设置发送电子邮件的示例代码

SmtpClient emailClient = new SmtpClient("smtp.mail.yahoo.com");
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("xyz@yahoo.com","*******"); 
emailClient.EnableSsl = true;
emailClient.Credentials = SMTPUserInfo;
emailClient.Port = 465;

MailMessage message = new System.Net.Mail.MailMessage("xyz@gmail.com", "someone@something.something", "fire!!", "Call up 911 and inform my house is on fire and my phone too");
emailClient.Send(message);
于 2012-10-07T15:51:33.860 回答
0

你可以检查这个项目:

http://www.codeproject.com/Articles/1684/Sending-Mail-Using-C-via-SMTP

在那里,您将看到如何设置配置以使用任何(在您的情况下为雅虎)smtp 服务器发送邮件以发送电子邮件。

于 2012-10-07T13:46:12.237 回答
0

You need to have smtp/pop access to yahoo mail in order to send the mail using yahoo account. The free account offered by yahoo does not have that access. You might have to opt for yahoo mail pro.

For sending a mail using SMTP, all you need is username and password of an smtp account. You will use the pass this credentials and send the mail with classes system.net.mail namespace.

于 2012-10-07T13:35:13.717 回答