|
|||
|
I'm testing Gmail as a smtp platform. It works great, but I seem unable to modify the From address using the setFrom() method.
$config = array('auth' => 'login', 'username' => 'myaccount [at] gmail.com', 'password' => 'mypassword', 'ssl' => 'tls', 'port' => 587); $userNotification = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config); $mail = new Zend_Mail(); $mail->setFrom('another [at] email.com','Another Email'); $mail->addHeader('another [at] email.com'); $mail->setReturnPath('another [at] email.com'); $mail->addTo($userEmail); $mail->setSubject($usernotificationsubject); $mail->setBodyText($usernotificationmessage); $mail->send($userNotification); I get a email with this "From:" header --> "Another Email <myaccount [at] gmail.com>" instead of "Another Email <another [at] email.com>" I tried : $mail->addHeader('From','another [at] email.com'); but the execution fails with this line. Is there any alternatives? Thanks! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|