Guest User

Untitled

a guest
Jan 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. use PHPMailerPHPMailerPHPMailer;
  2. use PHPMailerPHPMailerException;
  3.  
  4. require ROOT.'/vendor/autoload.php';
  5.  
  6. $mail = new PHPMailer(true);
  7. try {
  8. $mail->isSMTP();
  9. $mail->SMTPDebug = 2 ;
  10. $mail->Host = $senders['test']['host'];
  11. $mail->SMTPAuth = true;
  12. $mail->Username = $senders['test']['user'];
  13. $mail->Password = $senders['test']['pass'];
  14. $mail->SMTPSecure = 'ssl';
  15. $mail->Port = 465;
  16. $mail->CharSet = 'UTF-8';
  17. $mail->setFrom($senders['test']['user'], 'тутс' );
  18. $mail->addReplyTo($senders['project']['user'] , 'Тутс' );
  19. $mail->addAddress($mParams['address']);
  20. $mail->isHTML(true);
  21. $mail->Subject = $mParams['theme'];
  22. $mail->Body = $mParams['body_mail'];
  23. $mail->send();
  24. if(file_exists($mParams['file'])){
  25. $mail->addAttachment($mParams['file']);
  26. }else{
  27.  
  28. }
  29.  
  30. }catch(Exception $e){
  31. echo $mail->ErrorInfo;
  32. }
Add Comment
Please, Sign In to add comment