Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement