如何爲PHP Mandrill庫設置適當的FROM字段?Mandrill PHP庫 - FROM字段
在Java中,我可以使用:
from = "Some Description <[email protected]>";
如果我試圖在PHP一樣,我得到一個錯誤:
Validation error: {"message":{"from_email":"The username portion of the email address is invalid (the portion before the @: Some Description
與櫨這樣才電子郵件打通:
$from = "[email protected]";
萬一它很重要,這裏是我如何發送電子郵件:
$from = "Some Description <[email protected]>";
$message = array("subject" => $aSubject, "from_email" => $from, "html" => $aBody, "to" => $to);
$response = $mandrill->messages->send($message, $async = false, $ip_pool = null, $send_at = null);
上一個工作正常與PHP顯示我們的代碼,它會給你錯誤。 –
你的意思是第一個? – Buffalo
爲mandrill php庫看看如何設置發件人的名字在這裏https://mandrillapp.com/api/docs/messages.php.html有一個參數叫from_name – webDev