Dejo Dekic
Dejo Dekic

Reputation: 2126

How To Show My Site Name On Gmail instead "unknown sender"?

I am defining my php headers like so:

$sitename = 'My Site';<--Getting Site Name Dynamically So It Must be a variable-->              
$headers  = "From: " . $sitename . "\r\n";
$headers .= "Reply-To: ". $sitename ."\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=$get_charset" . "\r\n";       
$headers .= "X-Mailer: PHP/".phpversion();

On yahoo mail it works and my site name displayed properly but inside Gmail it shows as "unknown sender".
So how can I show my site name inside Gmail? Thanks.

Upvotes: 0

Views: 517

Answers (1)

Plenka
Plenka

Reputation: 1139

Add an email address, that's what the fields 'From' and 'Reply-To' are for:

$sitename = 'My Site <[email protected]>';

Upvotes: 3

Related Questions