views:

153

answers:

2

I use asp.net's smtpClient to send email, but recently I found it can only send the email to the same domain as the smtp server, if i try to send the email out of that , it will have such error:

mailbox can not be reached, * can not relayed**** I am sorry, i can not remember the exact message.

But this never happened before, why ?

thanks in advance

A: 

This is a matter of configuration. The SMTP server has to be configured to act as a gateway, which means it'll forward email to the SMTP server registered for the destination domain.

Typically, an organization's SMTP server will only act as a gateway for users connecting from the inside of the network, or who authenticate as members of the organization. You can also set up an SMTP server under IIS and configure it to act as a gateway. Then you'd send all mail to localhost, and it would do the rest.

Talk to your sysadmin.

Steven Sudit
A: 

Do you send email through the same server outside of ASP.NET (such as with Outlook)?

You likely have one of two problems:

The SMTP server is not configured for forwarding. This is not an ASP.NET/programming issue. The server must be setup as an SMTP gateway.

You are not passing username/password credentials to the server. On some servers you will still be able to send "internal" mail as long as you have an internal IP address, but the server will refuse to forward email to outside addresses.

David