我想对send email
我的用户,它工作正常。但由于某些原因,有些用户收不到我的邮件,我猜是因为他们email's format
的字数超过 3 个音节(a@b.c.r)
,但其他可以收到我邮件的邮件格式是这样的:a@b.c
现在我应该如何更改代码,以便send emails to every type of emails
.
这是代码:
MailMessage msg = new MailMessage();
msg.Priority = MailPriority.High;
msg.Subject = "Account Information";
// msg.ReplyTo = new MailAddress(TextBox2.Text);
msg.From = new MailAddress("waag@waag.ir");
msg.To.Add(new MailAddress(email));
SmtpClient mailsender = new SmtpClient();
mailsender.Host = "SmtpClient.waag.ir";
mailsender.Port = 587;
mailsender.EnableSsl = true;
mailsender.Credentials = new System.Net.NetworkCredential("waag@waag.ir", "classaspnet");
// mailsender loginInfo = new System.Net.NetworkCredential("waag@waag.ir", "classaspnet");
SmtpClient smtp = new SmtpClient();
msg.Body = bodyMsg.ToString();
这是网络配置文件代码:
<mailSettings>
<smtp from="waag@goldentest.ir">
<network host="mail.waag.ir" port="25" userName="waag@waag.ir" password="*****"/>
</smtp>
</mailSettings>
</system.net>