Problems converting code to send email

R

Robert Scheer

Hi.

I am porting an application from asp.net 1.1 to asp.net 2.0. This
application has a module that reads some data from a database,
including some email addresses. Then, I have a loop that sends a
message to every address returned from my database, as below:

For Each drwUser As DataRow In dtEmail.Rows
With mmMessage
.IsBodyHtml = False
.From = New
MailAddress("(e-mail address removed)")
.To.Add(drwUser(3).ToString)
.Subject = "Message title
.Priority = MailPriority.High
.Body = txtObs.Text.Trim
End With

Dim client As New
SmtpClient(XmlHelper.GetXmlKeyValue(Server.MapPath("../Parameters.config"),
"SMTPServer"))
client.Send(mmMessage)
End If
Next

When I run this code, if an email address does not exist, I receive a
recipient error. On the old 1.1 version, the email was returned to the
mailbox of the user Webmaster, but I didn't receive any error on the
application. I would like to send the message even if an email address
is wrong as on the old version. Is it possible?

Thanks,
Robert Scheer
 

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

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top