Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. $mail = new PHPMailer;
  2. $mail->isSMTP();
  3. $mail->Host = 'server'; // server that provide my hosting
  4. $mail->SMTPAuth = true;
  5. $mail->Username = 'exsample@domain.ltd';
  6. $mail->Password = 'my_password';
  7. $mail->SMTPSecure = 'ssl';
  8. $mail->Port = 465; // port provided by my hosting for smtp
  9.  
  10. $mail->setFrom('exsample@domain.ltd', 'PanaTech');
  11. $mail->addAddress($contacter['email'], $contacter['full_name']);
  12. $mail->addReplyTo('exsample@domain.ltd', 'PanaTech');
  13.  
  14. $mail->Subject = $subject;
  15. $mail->Body = $message;
  16. mail->AltBody = $message;
  17. if(!$mail->send()) {
  18. echo 'Message could not be sent.';
  19. echo 'Mailer Error: ' . $mail->ErrorInfo;
  20. } else {
  21. echo 'Message has been sent';
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement