public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { send("chenghai", "項目通知發送成功!", "有關OA詳細內容查看"); } public void send(string to, string subject, string content) { try { string fromEmail = "項目管理系統<[email protected]>"; string toEmail = to + "@163.com"; System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(System.Configuration.ConfigurationManager.AppSettings["webmail"].ToString()); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential("public", "public"); client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; } catch { }郵件發送不了 ,catch :郵件發送失敗,-------{"無法連接到遠程服務器"}如果你們又相關代碼粘出來 給我啊 ,
添加回答
舉報
0/150
提交
取消