Jump to content

[SOLVED] setting a name header for mails?


Yeodan

Recommended Posts

$subject = 'Mortal Ascension activation mail';
                $message = 'some link goes here 2';
                $headers = 'From: [email protected]' . "\r\n" .
                    "Reply-To: [email protected]" . "\r\n";

                mail($mail, $subject, $message, $headers);

 

how do I change the name that appears when receiving the mail?

atm this is [email protected]

it's supposed to be Mortal Ascension

Link to comment
https://forums.phpfreaks.com/topic/156528-solved-setting-a-name-header-for-mails/
Share on other sites

The format of the "From" line should be

Name <address>

The Name can be quoted

 

so you can change your code to

<?php
$subject = 'Mortal Ascension activation mail';
                $message = 'some link goes here 2';
                $headers = 'From: "Mortal Ascension" <[email protected]>' . "\r\n" .
                    "Reply-To: [email protected]" . "\r\n";

                mail($mail, $subject, $message, $headers);
?>

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.