I am using Zend Mail as follows:
$transport = new Zend_Mail_Transport_Smtp($smtpSettings['smtpServer'], $smtpSettings);
$mail = new Zend_Mail();
.
.
.
$mail->setFrom("support@somedomain.com", "Support");
.
.
.
$mail->send($transport);
I am successfully receiving the e-mail. But in place of the sender e-mail, instead of "support@somedomain.com", I am getting the G-Mail address (that I used up for SMTP configuration).
Does anyone have any idea how to fix this ?
I think the problem is that GMail SMTP server doesn't allow to send emails from @somedomain.com. You should use SMTP server installed on somedomain.com
Set
$mailInstance->clearDefaultFrom();
before
$mailInstance->setFrom($params['from'], $params['fromName']);