I'm sending email to mailtrap in this way
$mail = new Zend_Mail();
$mail->setFrom("[email protected]", '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 <[email protected]>
I also tried avoiding litteral name, so using only
$mail->setFrom("[email protected]");
The header is written using only
<[email protected]>
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('[email protected]', 'Temporary sender name');
$mail = new Zend_Mail();
$mail->setBodyText('...Your message here...');
$mail->send($transport);