I am using Laravel 4.2 and mandrill plugin. This way I can send emails using the laravel syntax (swiftmailer) and the mails are sent by mandrill. However, I can't seem to send HTML messages. They appear as text emails with htmltags inside. What could be wrong?
//Send email
$emailName = $_POST['emailName'];
$emailAddress = $_POST['emailAddress'];
$emailSubject = $_POST['emailSubject'];
$emailMessage = html_entity_decode($_POST['emailMessage']);
$emailFrom = $_POST['emailFrom'];
$emailFromName = $_POST['emailFromName'];
$pathToAttachement = $_POST['pathToAttachement'];
$data = array('emailAddress' => $emailAddress, 'emailName' => $emailName, 'emailSubject' => $emailSubject, 'emailFrom' => $emailFrom, 'emailFromName' => $emailFromName, 'pathToAttachement' => $pathToAttachement);
Mail::send('admin.emails.blank', array('msg' => $emailMessage), function($message) use ($data)
{
$message->setContentType('text/html');
$message->from($data['emailFrom'], $data['emailFromName']);
$message->to($data['emailAddress'], $data['emailName'])->subject($data['emailSubject']);
$message->attach($data['pathToAttachement']);
});
In your
blank.blade.php
template make sure you use double curly braces so that you don't escape the content