1

I am using cakephp 2.2

THis is my smtp setup in Config/email.php

public $gmail = array(
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'username' => 'appmailer@someapp.com',
        'password' => 'somepassword',
        'transport' => 'Smtp'
);

This is my email settings.

App::uses('CakeEmail', 'Network/Email');

$email = new CakeEmail('gmail');
$email->from(array('bigshot@company.com' => 'On Behalf of Big Shot'));

$email->to('client@bigshotclient.com');
$email->subject('[Test -- please ignore] one last test. Remember to hit REPLY to this email');
$email->sender('appmailer@someapp.com');
$email->replyTo('bigshot@company.com', 'Big Shot');

$email->send('Remember to hit REPLY to this email');

WHen the email is sent, the FROM address repeatedly shows

On Behalf of Big Shot<appmailer@someapp.com>

how can i make it such that the FROM appears as the original email address of bigshot@company.com?

By the way, the replyTo works very well.

I am attempting to perfect the mail delivery that is all.

Kim Stacks
  • 10,202
  • 35
  • 151
  • 282

1 Answers1

1

Apparently, Gmail SMTP will always overwrite the FROM field to prevent spamming.

See https://stackoverflow.com/a/3872880/80353

If anyone can help to attach the actual GMail documentation stating this point, that would be great.

Community
  • 1
  • 1
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282