Alex Gordon
Alex Gordon

Reputation: 60851

500 error when trying to use the MAIL function

We just migrated our PHP 5.2 / IIS 8 website to a new server.

We are unable to use the MAIL function.

mail($to, $subject, $message, $headers);

that returns:

the 500 error

  1. How do I enable detailed error messages?
  2. is there something I need to install to get the mail function to work?

Upvotes: 1

Views: 3774

Answers (2)

Jay Bhatt
Jay Bhatt

Reputation: 5661

By default PHP uses sendmail, You need to configure your PHP setting to use a SMTP server on windows.

The link below will get you started...

http://geekswithblogs.net/tkokke/archive/2009/05/31/sending-email-from-php-on-windows-using-iis.aspx

Upvotes: 3

Kinexus
Kinexus

Reputation: 12904

500 is a permanent smtp error and therefore there is either a problem with the configuration of the mail server or the recipient of the email.

If you telnet to the server on port 25 and issue the following commands;

helo localhost
mail from:<your.email.address>
rcpt to:<recipient.email.address>
data

ctrl c

What happens?

Upvotes: 1

Related Questions