Can't send email outside of the network

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
 
N

Norman Yuan

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top