Jump to content

Using php mail() in windows


ccravens

Recommended Posts

Hello:

 

I am running a Windows machine (yes... I know! ;-) Running apache, php, mysql... all that good stuff.

 

However, when I try and use the mail() function, it fails.

 

I do have an SMTP server running on port 25. Argosoft Mail Server 1.8 to be exact.

 

My php.ini settings are default

localhost

25

 

I have tried multiple SMTP server programs for windows. What else am I missing here that I can't send emails.

 

However, I can send emails when I run a Content Management System such as Joomla. But running a simple mail() call does not work. Any help for this is greatly appreciated! Thank you in advance!!

 

Here is the code example.

 

        $to = "[email protected]";

$body = "Test email";

$headers = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

 

if(mail($to, $subject, $body, $headers) == false) {

header("Location: http://www.we-mall.com/ErrorPage.php");

exit();

}

Link to comment
https://forums.phpfreaks.com/topic/39589-using-php-mail-in-windows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.