我收到消息說郵件發送。但是,在收件箱中有沒有新的郵件我發現,電子郵件在 server inetpub-> mailroot-> Queue
SMTP服務器不發送郵件
請告訴我這個
編輯
public string btnSendmail()
{
// System.Web.Mail.SmtpMail.SmtpServer is obsolete in 2.0
// System.Net.Mail.SmtpClient is the alternate class for this in 2.0
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress("[email protected]","");
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("[email protected]");
message.Subject = "Feedback";
message.IsBodyHtml = false;
message.Body = "Hello World" ;
smtpClient.Send(message);
return "Email successfully sent.";
}
catch (Exception ex)
{ return "Send Email Failed." + ex.Message;
}
分享您的代碼 – 2012-07-11 12:56:56
不需要顯示準確的電子郵件和pwds,如果他們是 – 2012-07-11 13:05:04
我得到了電子郵件在Sever-> Inetpub-> mailroot-> qu EUE – 2012-07-11 13:13:37