CodeIgniter Forums
SMTP Authentication in codeigniter email - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: SMTP Authentication in codeigniter email (/showthread.php?tid=37257)



SMTP Authentication in codeigniter email - El Forum - 01-04-2011

[eluser]Thimuth[/eluser]
Hi,
I'm using email library to send emails using gmail smtp server.And I'm setting the from name as follows.

Code:
$config['protocol']  = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'testmail';
..
..// initializing and setting other parameters
..
$this->email->from([email protected], 'Im the sender');
..

But, in the email i receive, it shows as :- "From : Im the sender<[email protected]> "
instead of " From : Im the sender<[email protected]> ".
This happens only when authenticate using Gmail SMTP . If you use yahoo or any other SMTP settings, from parameter will work as it should be.
This happens if you use PHPMailer library also.

Is there any way to change From parameter when Gmail SMTP is used to authenticate?


SMTP Authentication in codeigniter email - El Forum - 01-04-2011

[eluser]Cristian Gilè[/eluser]
Gmail automatically rewrites the "from" line of any e-mail you send via their SMTP gateway to your Gmail address. The solution is to go into your gmail Settings:Accounts and "Make default" an account other than your gmail account. This will cause gmail to re-write the From field with whatever the default account's email address is. I think, there is no other solution.