我正在尝试通过 mailjet 在我的 zend 应用程序上发送电子邮件。它可以工作,但无法加载所需的模板。代码:
$config = array('ssl' => 'ssl',
'port' => 465,
'auth' => 'login',
'username' => 'mailjet api username',
'password' => '8mailjet api key');
$transport = new Zend_Mail_Transport_Smtp('in-v3.mailjet.com', $config);
$mail = new Zend_Mail();
$mail->addHeader('X-MJ-TemplateLanguage',true);
$mail->addHeader('X-MJ-TemplateID','validationV2');
// This is the template I wanna use.(above)
$mail->setFrom('test@test.org', 'You');
$mail->addTo('test@test.org', 'Anybody');
$mail->setSubject('My first email by Mailjet');
$mail->setBodyHtml('wxxxxxxxxxxxxxxxxxxxxxxxxx');
$mail->send($transport);
如果我能得到任何帮助,那就太好了!