473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

SMTPMail Error

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
2 1991
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: arkam | last post by:
Hi, I tryed to send an email with the smtpmail class in the .net framework and I got an error in Outlook. Here is my code: System.Web.Mail.MailMessage mail = new...
8
by: Jason | last post by:
Hi not sure if this is the write place, but i really need some help with this...! I have a piece of code that sends email using the SmtpMail class, in an ASP.NET web application, with...
6
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
0
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To =...
2
by: Edward | last post by:
Hello, everybody, I tried to send Email out using ASP.NET, but failed, here is the code of sending: -------------------------------------------------------------------------------- Try...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.