SMTPMail Error

W

Wayne Wengert

I have an aspx page in which I step through emails from a SQL Server table
and snd each a custom email message. The emails in that table are all valid
formats. When I run the page I immediately get the following error message:

----------------------------------
Exception Details: System.Runtime.InteropServices.COMException: The server
rejected one or more recipient addresses. The server response was: 501 5.5.4
Invalid Address
-----------------------------------

None of the emails are actually sent and I have no email address that looks
anything like "5.5.4". The relavent code is below. Any thoughts on what
causes this error message?

============== code ==================
Private Sub SendData(ByVal id As Int32, ByVal email As String)

'Create an instance of the MailMessage class

Dim objMM As New MailMessage



objMM.To = email

objMM.From = "(e-mail address removed)"



objMM.BodyFormat = MailFormat.Html

'Set the priority - options are High, Low, and Normal

objMM.Priority = MailPriority.Normal

'Set the subject

objMM.Subject = "Email Verification"

'Set the body

Dim baseUri As New Uri("http://www.mySite.org/")

Dim myUri As New Uri(baseUri, "verifyemailaddress.aspx?i=" & id.ToString)

objMM.Body = "To verify the email address you have registered with
mySite.org " _

& "please click on the following link: " _

& vbCrLf & "<p/><a href=""" & myUri.ToString & """>" & myUri.ToString &
"</a>" & vbCrLf _

& "<p /> If your email system does not allow active links, copy the link to
your browser's " _

& "address box."

'Specify to use the default Smtp Server

SmtpMail.SmtpServer = "localhost"

SmtpMail.Send(objMM)

End Sub
 
A

Alejandro Penate-Diaz

the problem may be the address in your "from" field, some smtp servers are
configured to reject all emails that come from unknown senders. so try and
create a pop account and then try to send FROM that address. Hope that
helps.
Regards,
Alejandro Penate-Diaz
 
W

Wayne Wengert

Alejandro;

Thanks for the response. I ran some test and I find that if I limit the list
of emails to send to 1 or 2, it works? When I let it try to loop through the
whole list (175 addressees) I get the error.

Is there some way I can tell it to "wait" untile the current email is sent
before I send the next one?

Wayne
 
Joined
Oct 17, 2007
Messages
7
Reaction score
0
Did you ever get around this issue? Please let me know the solution, as I am having the same problem and my ASP.NET code is pretty much similar to what you have.

Thanks,
UrStop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top