I'm sending email to mailtrap in this way
$mail = new Zend_Mail();
$mail->setFrom("senderaddress@yahoo.it", 'Temporary sender name');
I am already using mail trap for a lot of projects, so I know that I can send email using these email address and name as "from"
The problem is that $mail->send()
throws an Exception
5.1.7 Bad sender address syntax
So I debugged Zend code. I am now sure it's sending from as
Temporary sender name <senderaddress@yahoo.it>
I also tried avoiding litteral name, so using only
$mail->setFrom("senderaddress@yahoo.it");
The header is written using only
<senderaddress@yahoo.it>
But nothing changed
I am not able to understand if this very old Zend project is NOT sending at all the message or if Mailtrap is refusing.
You can try this way:
Zend_Mail::setDefaultFrom('senderaddress@yahoo.it', 'Temporary sender name');
$mail = new Zend_Mail();
$mail->setBodyText('...Your message here...');
$mail->send($transport);