Reputation: 3754
I was trying to set from in php mailer (gmail smtp). But in inbox it shows from [email protected]. here is my code :
$this->_mail->Username = "[email protected]";
//Password to use for SMTP authentication
$this->_mail->Password = 'mypassword';
$this->_mail->From="[email protected]";
$this->_mail->FromName="Support Team";
//Set who the message is to be sent from
$this->_mail->setFrom('[email protected]', 'Support Team',false);
But when I receive email in inbox its show from : [email protected] and I want to show from : [email protected]
Can anyone help me to find out what I am missing.
Upvotes: 1
Views: 1623
Reputation: 37710
This is a gmail restriction, though it's not all bad news! In your gmail preferences you can configure aliases for your account, and you can send out using them as your from address. So you can set the from address, but only to a choice from that preset list, not any arbitrary address. This question has been asked on here before.
Upvotes: 3