By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,910 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,910 IT Pros & Developers. It's quick & easy.

SMTPMail Error

P: n/a
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 = "we*******@mySite.org"

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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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 = "we*******@mySite.org"

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

Nov 19 '05 #2

P: n/a
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

"Alejandro Penate-Diaz" <al********@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP12.phx.gbl...
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
"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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 = "we*******@mySite.org"

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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.