Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

3 of 3
Commonmark migration

Check out php mail in the manual

additional_headers (optional)

String to be inserted at the end of the email header.

This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n).

Example from the manual

$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
 'Reply-To: [email protected]' . "\r\n" .
 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

Update:

You also asked about putting the name in the from address. To do this just change the From: in the headers to WEBMASTER NAME <[email protected]>

bretterer
  • 5.8k
  • 5
  • 34
  • 54

AltStyle によって変換されたページ (->オリジナル) /