SHARE
TWEET

Untitled

a guest Jun 18th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >  MAILER_URL=smtp://localhost:25?encryption=ssl&auth_mode=login&username=*****%40live.com&password=******
  2.      
  3. >  MAILER_URL=smtp://smtp-mail.outlook.com:25/encryption=ssl&auth_mode=login&username=*******%40live.com&password=********
  4.      
  5. public function sendMail($subject, $fromEmail, $toEmail, $emailTemplate, $argumentsArray, $emailType, $imgPath)
  6. {
  7.     $message = $this->setBasicEmailMessage($subject, $fromEmail, $emailTemplate, $argumentsArray, $emailType, $imgPath);
  8.     $message->setTo($toEmail);
  9.     $this->mailer->send($message);
  10. }
  11.  
  12.  
  13. private function setBasicEmailMessage($subject, $fromEmail, $emailTemplate, $argumentsArray, $emailType, $imgPath)
  14. {
  15.     $message = (new Swift_Message($subject))->setFrom($fromEmail);
  16.     $img = $message->embed(Swift_Image::fromPath($imgPath));
  17.     $argumentsArray['img'] = $img;
  18.     $message->setBody(
  19.         $this->templating->render(
  20.             $emailTemplate,
  21.             $argumentsArray
  22.         ),
  23.         $emailType
  24.     );
  25.  
  26.     return $message;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top