Welcome Guest, Not a member yet? Register   Sign In
SMTP Authentication in codeigniter email
#1

[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?
#2

[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.




Theme © iAndrew 2016 - Forum software by © MyBB