PDA

View Full Version : php's mail function


Mortimer Jazz
04-09-2003, 07:06 PM
I was just going through Jesse's php/emailer tute on this site but I can't the mail part to work

//This works:
mail("me@myhost.co.uk", $subject, $message, $mailFrom);

//but this doesn't
mail("me@myhost.co.uk", $subject, $message, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());

$from is defined
Can someone tell me where I could be going wrong?
---------------------------------------------
Also, does flashMX now use \n instead of \r for newlines? or do we have to still swap them over before sending text to php?

Cheers

CyanBlue
04-10-2003, 07:26 AM
Um... Don't really know what's wrong with that code, but I can show you the working one... <?php
$message = "Hi, from Jason.";
mail("CyanBlue@ActionScript.org", "Test from Jason at localhost", $message,
"From: CyanBlue@$SERVER_NAME\r\n"
."Reply-To: CyanBlue@$SERVER_NAME\r\n"
."X-Mailer: PHP/" . phpversion());
?>I have no idea about that carriage return... My brain just get escaped whenever I see those escape characters... :D