Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP problem

Status
Not open for further replies.

sirugo

Programmer
Aug 1, 2000
162
SE
I'm having a problem with sending mail using the mmail() function in php.

We have a local SMTP-server that seems to be configured to let the webserver use it for sending mails.
The mails work well when the addresses are within the domain but whenever we try to send a mail outside the domain (for example to yahoo), we get the Server Error 500.

Where is the problem?

// setting the SMTP-server temporarily
ini_set ('SMTP','mail.domain.com');

// sending outside the domain doesnt work!
mail( 'someone@yahoo.com', 'subject', 'message' );

// sending inside the domain works!
mail( 'someone@domain.com', 'subject', 'message' );



 
Yes, it does.
The SMTP is actually a FirstClass server with about 200 users using it to send around the world every day.
But the php script cannot.
 
Are you running PHP on Win32 or *nix?

If you're running it on Win32, have you set up the SMTP settings in php.ini?

Also, has the SMTP server been configured to allow relaying from the IP address of your PHP machine? Want the best answers? Ask the best questions: TANSTAAFL!
 
As you can see I use the ini_set function to temporarily choose the SMTP-server.

And the mail-admin says that the SMTP-server is configured to relay from that IP.

But why do the internal addresses work and not addresses outside the domain?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top