protected function getMailer()
{
// If the mailer has already been defined via the constructor, return it.
if ($this->mailer) {
return $this->mailer;
}
// Get the proper transporter
switch ($this->config('mailer.transport')) {
case 'smtp':
$transport = $this->getSmtpTransport();
break;
case 'mail':
$transport = $this->getMailTranport();
break;
default:
$transport = $this->getSendMailTransport();
}
return \Swift_Mailer::newInstance($transport);
}