Can't send email outside of the network

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have Asp.net 2.0 app that needs to send an email. It works fine when the
app tries to send inside of the network, but I can’t send email outside.
Does anyone know how I can resolve the problem? My code is as follows:

Dim objMail As New System.Net.Mail.MailMessage

'populage info
objMail.From = New MailAddress(“[email protected]â€)
objMail.To.Add(“[email protected]â€)
objMail.Subject = “testâ€
objMail.Body = “Test Mailâ€
objMail.IsBodyHtml = True

Dim smtp As New
SmtpClient(Configuration.WebConfigurationManager.AppSettings("defaultServer"))
smtp.Send(objMail)

Thank you very much for your advice.
Chieko
 
Does the user account running your ASP.NET app has necessary permission to
the SMTP server?

By "outside of the network", do you mean the IIS server and the SMTP server
are not in the same local network? or do you mean a user's client browser
reaches your ASP.NET app from outside network?
 
Thanks for youre response. I think my app has the necessary permission to
the SMTP server.
My app can send an email if "To" address is the same as the domain name but
can't send if "To" address isn't the same as the domain name. Hope I answer
your questions.

Thanks
Chieko
 
Back
Top