svk
svk

Reputation: 4553

How to display name in the from address?

I have a site in PHP.In this when I send the invitation to people it takes the from address as [email protected] of this I want o display the Mysitename .How can I do.I have the code shown below.

                    $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'To:'. $value . "\r\n";
        $headers .= 'From:Mysitename'."\r\n";

How can I show like in users email's from address is Mysitename?

Thanks in advance?

Upvotes: 1

Views: 5443

Answers (2)

Kamil Szot
Kamil Szot

Reputation: 17817

Maybe something along the lines of:

$headers .= 'From: Mysitename <[email protected]>' . "\r\n";

You need 'From' to be proper email address.

Upvotes: 1

Galen
Galen

Reputation: 30170

$headers .= 'From: Mysitename <mysitename.com>' . "\r\n";

http://php.net/manual/en/function.mail.php

Upvotes: 5

Related Questions