62,046
社区成员
发帖
与我相关
我的任务
分享
System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.From = "TAD@cola.com"; msg.To = MessageTo; //抄送人 msg.Cc = MessageCc; msg.Subject = MessageSubject; msg.BodyFormat = MailFormat.Html; msg.Body = MessageBody; SmtpMail.SmtpServer = "smtp.ym.163.com"; msg.Priority = MailPriority.Normal; msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "TAD@cola.com"); msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "123456"); //调用以上方法 : string chaosong = "liumei@163.com"; string body = "请把以下链接复制到浏览器地址栏里面"; fun_Mail("liumei@163.com", chaosong, "test", body); 这样会接收不到邮件。 而把接收邮箱改成 liumei@cola.com则 发送成功。
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);
System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();
msg.From = "service@colago.com";
msg.To = MessageTo;
//抄送人
msg.Cc = MessageCc;
msg.Subject = MessageSubject;
msg.BodyFormat = MailFormat.Html;
msg.Body = MessageBody;
SmtpMail.SmtpServer = "smtp.ym.163.com";
msg.Priority = MailPriority.Normal;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "service@colago.com");
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "colago708");