0
這用於在舊服務器上工作,並且備份了文件並使系統在新服務器上運行。數據庫都是完整的並且連接好,文件都在那裏,但是無論何時用戶想要註冊,他們都會收到「Failure sending mail」錯誤。移動到新服務器後,ASP Mail功能不起作用
這是在處理激活郵件發送設好註冊文件行:
MailClass.MailGonder("[email protected]", TxtEMail.Text, "Aktivasyon Kodu", body, "[email protected]", "mypasswordishere", "mail.mysite.com", 587);
這是Mail_Class.cs文件,我敢肯定,處理整個郵件的事情:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;
using System.Net;
namespace Sngl
{
public class MailClass
{
public MailClass() { }
public static void MailGonder(string kimden, string kime, string title, string body, string senderEmail, string senderPassword, string smtpServer, int port)
{
try
{
System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage(kimden, kime, title, body);
MyMailMessage.IsBodyHtml = true;
MyMailMessage.Priority = System.Net.Mail.MailPriority.High;
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential(senderEmail, senderPassword);
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient(smtpServer, port);
mailClient.EnableSsl = false;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
mailClient.Send(MyMailMessage);
PropertyClass.Result = true;
}
catch (Exception ex)
{
PropertyClass.Result = false;
PropertyClass.Message = ex.Message;
}
}
}
}
註冊過程會彈出「發送失敗郵件」錯誤消息,並且不會發送激活郵件。 – 2012-03-14 09:03:33
'發送郵件失敗'是否被捕獲的實際異常?您是否嘗試過使用調試器來查看是否有關於異常的更多信息? – patmortech 2012-03-14 09:11:01
我熟悉PHP,但這是我的第一個ASP站點。我怎麼做? – 2012-03-14 09:12:48