brian-welch
brian-welch

Reputation: 461

Removing 'gmail.com' from the 'from' when using gmail smtp and phpmailer

I am using PhpMailer to send emails via gmail smtp. And while $mail->setFrom('[email protected]','Jack Schmitt'); does insert 'Jack Schmitt' as the name of the sender, it is still including my smtp username. So the recipient will see something like this: Jack Schmitt<[email protected]> in the From: line

Is there a way to have it say Jack Schmitt<[email protected]> in stead?

Upvotes: 0

Views: 234

Answers (1)

Synchro
Synchro

Reputation: 37710

You can't send using arbitrary from addresses, because that would usually be forgery. You can only send from your account address or predefined (in gmail settings) aliases. This is a gmail feature covered in their docs.

Upvotes: 1

Related Questions