Page 1 of 1

mail(from)

Posted: Thu Oct 23, 2003 2:30 pm
by d3ad1ysp0rk

Code: Select all

<?php
mail("lppunkskater@hotmail.com", "Automated Scipt", "$mailcontent");
?>
where would i put the $username variable to specify a sender?

Posted: Thu Oct 23, 2003 2:52 pm
by Kriek
See -> the mail() function's additional_parameters.

Code: Select all

<?php
    $sendto = 'lppunkskater@hotmail.com';
    $subject = 'Automated Scipt';
    $header = "From: $name\r\nReply-To: $email\r\n";
    mail($sendto, $subject, $mailcontent, $header)
?>

Posted: Thu Oct 23, 2003 2:57 pm
by DuFF
"From" is actually a header that is included in the email. Heres an example. More at http://www.php.net/function.mail

Code: Select all

<?php
$to = "youremail@address.com";
$subject = "Hello There";
$message = "How are you doing?";
$headers = "From: sender@example.com\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Cc: example@example.com\r\n";
$headers .= "Bcc: example@example.com\r\n";
mail($to, $subject, $message, $headers);
?>