setHost(config('mail.smtp.server')) ->setPort(config('mail.smtp.port')); if (config('mail.smtp.secure')) { $transport->setEncryption(config('mail.smtp.secure')); } if (config('mail.smtp.auth')) { $transport ->setUsername(config('mail.smtp.username')) ->setPassword(config('mail.smtp.password')); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance($subject) ->setFrom([config('mail.smtp.from') => config('mail.smtp.name')]) ->setBcc($to) ->setBody($body); return $mailer->send($message); }