I want to email a message but how can i define the sender of the message. I use the following command
Code: Select all
mail( $to, $subject, $message );
Moderator: General Moderators
Code: Select all
mail( $to, $subject, $message );
Code: Select all
mail($to, $subject, $message, $headers);
Code: Select all
$from = "your.address@somewhere.com";
$to = "yourmomma@hotmail.com";
$subject = "Hello";
$body = "Hi mum, how are you?";
$header = "From: $from\r\n";
$flag = "-f$fromAddress";
mail($to,$subject,$body,$header,$flag);