I'm using the following code to sending emails. If i gave the gmail server name, user id and password, its working fine. If i gave my own server name, user id and password, i'm getting the following error. Error message is "Unable to send to all recipients".
Dim smtp As SmtpClient = New SmtpClient() Try smtp.Host = smtphost smtp.EnableSsl = False mm.ReplyTo = New MailAddress(uname) Dim NetworkCred As NetworkCredential = New System.Net.NetworkCredential() NetworkCred.UserName = uname NetworkCred.Password = pwd smtp.UseDefaultCredentials = True smtp.Credentials = NetworkCred smtp.Send(mm) Return True Catch ex As Exception MsgBox(ex.Message) Return False Finally smtp = Nothing mm = Nothing End Try
Check whether you are passing correct SMTP port number. Also check whether your smtp server requires SSL or not. You can also trace the problem using System.NET.Tracing. Following link might help you will steps for tracing
My smtp server does not require the ssl. The same coding worked fine in visual studio 2005. Now i upgrade that coding to visual studio 2008. After upgrading, i'm getting this error. How to solve this? Help me...