[thelist] mail() on windows server

Jack Timmons jorachim at gmail.com
Sat Dec 27 06:54:45 CST 2008


On Fri, Dec 26, 2008 at 9:20 PM, Bob Meetin <bobm at dottedi.biz> wrote:

> The script below works on linux/apache servers fine but on a windows
> server it fails to send email; the PHP works, but no delivery.  I
> checked my spam service to see if it got caught.
>
> from phpinfo:
>
> System: Windows NT WEBB26 5.2 build 3790
> sendmail_path: no value
> Internal Sendmail Support for Windows: enabled
>
> Path, something else?  'fraid windows is not in my bag of tricks, so
> just guessing?
>
>
> <?php
>
> $to = "bobm at dottedi.biz";
> $from = "From: customer_service at wherever.com";
> $subject = "Contact form";
> $headers = "From: me at mycompany.com\r\nReply-To: someone_else at mycompany.com
> ";
>
> $my_body = "test test";
>
> mail ($to, $subject, $my_body, $from);
> mail("$to", "$subject", "$my_body", "$headers");
>
> echo "finished<br>";
> // phpinfo(); // just to see
>
> ?>
>
>
Bob,

Windows is requiring you to use SMTP to send your e-mail. Your best best is
to download the PHP Mailer Class[1] and extend it to fit your own purposes.
That should work just fine.

[1] - http://phpmailer.codeworxtech.com/index.php?pg=sf&p=dl

-- 
-Jack Timmons
http://www.trotlc.com



More information about the thelist mailing list