I'm trying to send an email from asp.net 4.0 and all i get is an error saying :- ERROR Failure sending mail. I am using the below code, some of which taken from another thread.
Dim msg As MailMessage = New MailMessage()
Dim smtp As New SmtpClient("smtp.mydomain.com")
msg.From = New MailAddress(strFromAddress, strFromUser)
msg.To.Add(New MailAddress(strEmailAddress, strRecipient))
msg.IsBodyHtml = False
msg.Subject = ""
msg.Body = ""
Dim credLogin As System.Net.NetworkCredential = New System.Net.NetworkCredential("Do-Not-Reply@mydomain.com", "mypassword")
smtp.Credentials = credLogin
smtp.Send(msg)
Does anyone know what I am doing wrong and what the error is. I've set up the from email address.


Reply With Quote

