Unable to send to all recipients


  • Hi,

            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()
                    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
                    Return True
                Catch ex As Exception
                    Return False
                    smtp = Nothing
                    mm = Nothing
                End Try
    Monday, December 28, 2009 6:45 AM

All replies

  • 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

    Gaurav Khanna
    Monday, December 28, 2009 7:22 AM
  • 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...
    Monday, December 28, 2009 7:26 AM