Error Send E-mail

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Dear All,
Ive problem send email with vb.net
here my code :
Dim mail As New MailMessage()<br/>
Dim SmtpServer As New SmtpClient()<br/>
<br/>
mail.To.Add(emailTo)<br/>
mail.From = New MailAddress(senderEmail)<br/>
mail.Subject = "Surbakti Billing"<br/>
mail.Attachments.Add(New Attachment(filepath))<br/>
mail.Body = emailBody<br/>
SmtpServer.Host = "smtp.surbakti.net"<br/>
SmtpServer.Port = 587<br/>
SmtpServer.Timeout = 100000<br/>
SmtpServer.ServicePoint.MaxIdleTime = 0<br/>
<br/>
SmtpServer.Send(mail)<br/>
mail.Dispose()
Catch ex As Exception<br/>
result = ex.ToString<br/>
End Try<br/>
Return result
for 4 or 5 email there are no error, but I got error when the next email :
System.Net.Mail.SmtpException: Service not available, closing transmission channel. The server response was: 4.7.0 Too many messages.<br/>
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
the problem is after i got that error, next email will be send but after send 4 or 5 email i got that error again.
send 4 or 5 email that error show, after that error, email will send 4 or 5 and got error again.
what is that i missing or what must i do to fix that problem?
thank you for anyhelp.
Thanks
Surbakti

View the full article
 
Back
Top