Mandrill
Mandrill copied to clipboard
Please help invalid-sender.
help me, im using Laravel 5, but the email didnt sent to destination. when i print $result[0]["reject_reason"] the result is invalid-senderNULL,
can you help me??
if im using mandrill for sendmail without this class, its work. but i need your class to using mandrill template but the email didnt sent. because the invalid sender.
here is my code.
`namespace App\Services;
use Weblee\Mandrill\Mail;
class WebleeMail{
private function welcomeEmail($userEmail,$userName){
try{
$template_name = 'forgot_password';
$template_content = array(
array(
'name' => 'test',
'content' => 'test'
)
);
$message = array(
'to' => array(
array(
'email' => $userEmail,
'name' => $userName,
'type' => 'to'
)
)
);
$result = \MandrillMail::messages()->sendTemplate($template_name, $template_content, $message);
if($result[0]["status"]=="sent" AND !$result[0]["reject_reason"]){
return true;
}
else{
return $result[0]["reject_reason"];
}
}
catch(Exeption $e){
return false;
}
}
public function testEmail(){
echo $this->welcomeEmail("[email protected]","test");
}
}`
Well, you are missing the from: field.