Last post Dec 30, 2009 06:05 AM by shabirhakim1
Dec 30, 2009 05:49 AMfirstname.lastname@example.org|LINK
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
Catch ex As Exception
smtp = Nothing
mm = Nothing
Dec 30, 2009 05:59 AM|b471code3|LINK
By your own server name id and password what do you mean? Are you using Exchange server on a local network? If so you will have to add the IP address (or range) of your local machine to the allowed to relay area in Exchange (or have your systems administrator
Dec 30, 2009 06:05 AM|shabirhakim1|LINK
hope this will resolve your problem
While transferring one of my application to another server this problem arises to my one ASP.net 2.0 application. First i thought to chek web.config to check all the SMPT setting for new server.And yes this is also the FIRST thing to do. But i find out the
was a relay error. I just need to configure my smtp server to relay properly.
Just to go your IIS -> Default SMTP Virtual Server -> Properties -> Access -> Relay Restrictions
and set the relay restricition properties according to your requirement .