如何使用vb.net发送批量电子邮件列表 [英] How do I Send bulk email list using vb.net
问题描述
我想将简报发送到电子邮件列表,但每封电子邮件都需要根据电子邮件地址进行修改..
正在从另一台服务器处理发送,而不是托管的服务器。 。
i制作一个使用System.Net.Mail发送的代码,但在发送到特定数量的电子邮件后,
服务器返回错误..并且发送过程无法继续
方法从每个发送过程之间延迟4秒的线程开始
可以任何机构给我一些关于我发生的问题的信息:)
这里代码:
< pre lang =vb> Dim mSmtpClient As New SmtpClient(S_Smtp,S_port)
Dim mMailmessage As 新 MailMessage
尝试
mSmtpClient.Credentials = 新 System.Net.NetworkCredential(S_User, S_pass)
mMailmessage.ReplyToList.Add( New MailAddress(S_replyto))
mMailmessage.From = 新 MailAddress(发件人& <& S_User& >)
mMailmessage.Subject = subject
Dim Overallmail 作为 整数 = str.Rows .Count
' --- ----------------开始发送-------------------------------- -------------------------
对于 i = 0 str.Rows.Count - 1
Dim bodymail As String = body
email = str.Rows(i).Item( 0 )。ToString
bodymail = bodymai l.Replace(oldmail,email).Replace( [email],email)
htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(bodymail, Nothing , text / html)
' mSmtpClient。 DeliveryMethod = SmtpDeliveryMethod.Network
mMailmessage.AlternateViews.Add(htmlView)
mMailmessage.IsBodyHtml = True
' 执行得太快,无法看到线程正常工作。
mMailmessage。[要]。添加(新 MailAddress(电子邮件))
''' ''''''''''''''''''''' '
mSmtpClient''
mSmtpClient 。发送(mMailmessage)
''' ''''''''''
mMailmessage。 To .Clear()
mMailmessage.AlternateViews.Clear()
Thread.Sleep(oXMLparams.GetParamValue( EmailEvery) )
结束 如果
问题很可能是你的托管服务有de因为它怀疑你是垃圾邮件发送者或者你的网站被垃圾邮件发送者所侵害,所以发送了大量的电子邮件,并阻止你再发送邮件。
解决这个问题的唯一方法是与您的托管服务部门联系,准确说明您正在做什么,并要求他们提供最好的处理方式。
每天5000多封电子邮件,每天都是许多。许多人会将其视为垃圾邮件生成器。
I want to send the newsletter to a list of email but every email need modification according to the email address ..
the sending is being processed from another server than the one that is hosted on ..
i make a code that send using System.Net.Mail but after sending to a specific number of emails the
server return an error .. and the sending process fail to continue
the method start by a thread that delay 4sec between every sending process
can any body give me some information about the problem that is happening with me :)
here the code:
Dim mSmtpClient As New SmtpClient(S_Smtp, S_port)
Dim mMailmessage As New MailMessage
Try
mSmtpClient.Credentials = New System.Net.NetworkCredential(S_User, S_pass)
mMailmessage.ReplyToList.Add(New MailAddress(S_replyto))
mMailmessage.From = New MailAddress(sender & "<" & S_User & ">")
mMailmessage.Subject = subject
Dim Overallmail As Integer = str.Rows.Count
'-------------------start Sending---------------------------------------------------------
For i = 0 To str.Rows.Count - 1
Dim bodymail As String = body
email = str.Rows(i).Item(0).ToString
bodymail = bodymail.Replace(oldmail, email).Replace("[email]", email)
htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(bodymail, Nothing, "text/html")
'mSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network
mMailmessage.AlternateViews.Add(htmlView)
mMailmessage.IsBodyHtml = True
'execute too fast to see the thread working.
mMailmessage.[To].Add(New MailAddress(email))
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
mSmtpClient.Send(mMailmessage)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
mMailmessage.To.Clear()
mMailmessage.AlternateViews.Clear()
Thread.Sleep(oXMLparams.GetParamValue("EmailEvery"))
End If
The problem is most likely that your hosting service has detected a large number of emails going out, and is preventing you sending any more as it suspects that either you are a spammer or your site has be compromised by a spammer.
The only way round this is to talk to your hosting service, explain exactly what you are doing and ask them for the best way to handle it.
5000+ emails a day, every day, is a lot. Many would consider that as a spam generator.
这篇关于如何使用vb.net发送批量电子邮件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!