Problem with System.Net.Mail

KMW

Guppy
I am using the following code to send a single email to a users. The cc email is coming through but the email to [email protected] is not. I have gotten messages several hours later that these email are being delayed (I am only testing now so these are all coming to me). I have tried setting some parameters in my web.config file but right now have nothing there with regards to email.

Dim Mail As New System.Net.Mail.MailMessage
Dim em As String = "[email protected]"

Dim m As String = "Test"
Mail.From = New System.Net.Mail.MailAddress(em, "KW")
Mail.To.Add("[email protected]")
Mail.Subject = "Test Message"
Mail.Body = m
Mail.IsBodyHtml = False
Mail.CC.Add(em)
Dim smtp As New System.Net.Mail.SmtpClient("localhost")
Mail.Headers.Add("Reply-To", em)
Mail.Priority = System.Net.Mail.MailPriority.Normal
smtp.Credentials = New System.Net.NetworkCredential(em, "****")
smtp.Send(Mail)

Any help would be appreciated.
Thanks
Kevin
 
Here's the answer
http://support.jodohost.com/showthread.php?t=494&page=2
I was testing this by sending an email to my comcast account.
According to this post the large isp's require reverse dnd, which you don't get when you use smtp=localhost. In order to get reverse dns you have to use smtp=mail.mydomain.com with smtp authentication. Im any case, this worked. I started with smtp=mail.mydomain.com but without authentication, then switched to localhost, then added authentication - none of which worked, but using smtp=mail.mydomain.com and smtp authentication as shown in my original post works.
 
Back
Top