我正在使用 smtp.corp 从 ASP.NET 站点发送电子邮件。选择 50 封邮件时,这里所有邮件都已发送(显示状态为已发送),但只有少数成员正在接收邮件(只有 10 个成员)。如何在 asp.net 中发送批量电子邮件?
如果选择 15 封邮件,则有 10 封邮件正在发送,其余的不发送。对于剩余的电子邮件,我从 SMTP 服务器收到此错误:
服务不可用,正在关闭传输通道。服务器响应为:并发 SM 过多
System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage();
try
{
if (From == "") From = GetConfigVal("emailfrom");
//System.Net.Mail.MailMessage MyMailMessage = new
System.Net.Mail.MailMessage(From, To, Subject, MailBody);
if (FromName.Trim() != "")
{
MyMailMessage.From = new System.Net.Mail.MailAddress(From, FromName);
}
else
{
MyMailMessage.From = new System.Net.Mail.MailAddress(From);
}
MyMailMessage.To.Add(To);
MyMailMessage.Subject = Subject;
MyMailMessage.Body = MailBody;
if (ReplyEmailID.Trim() != "")
{
MyMailMessage.ReplyToList.Add(new
System.Net.Mail.MailAddress(ReplyEmailID));
}
if (CC.Trim() != "")
{
MailAddress copy = new MailAddress(CC);
MyMailMessage.CC.Add(copy);
}
MyMailMessage.IsBodyHtml = isHTML;
//Proper Authentication Details need to be
// passed when sending from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential(GetConfigVal("smtpuser"),
GetConfigVal("smtppassword"));
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient(GetConfigVal("smtp"), int.Parse(GetConfigVal("smtpport")));
//Enable SSL
//mailClient.EnableSsl = true;
//mailClient.Port = 25;
mailClient.EnableSsl = false;
//mailClient.UseDefaultCredentials = true;
mailClient.Credentials = mailAuthentication;
mailClient.Send(MyMailMessage);
}