Click to See Complete Forum and Search --> : smtp


Anon
02-12-2002, 11:18 PM
i can't seem to get php to send mail.

i'm running a smtp server called "ArGoSoft Mail Server" on the same box as my webserver.

it works fine when i use it with perl but when i try to mail someone i get an unknown error on the line with the mail() command.

i have a file named mailtest.php with nothing but this line in it:
<?php mail("akasler@columbus.rr.com", "test subject", "test message") ?>
and it says unknown error.

in my php.ini file i have smtp = localhost (i use localhost in perl and it sends mail without a problem).

anyone know what the problem is?

flipis
02-15-2002, 12:25 PM
Well, actually, if that is the only line of yor code, probably it won't work.

Define 3 variables:

$to="me@you.him";
$subject="whatever";
$message="whatever";

if(!mail($to,$subject,$message)){
echo "Mail not sent";
}

Hope it helps.

fLIPIS

Anon
02-15-2002, 07:02 PM
i figured it out, i was editing php.ini in the php directory instead of the one in the windows directory.