Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. $mail = new PHPMailer(true);
  2. $mail->IsSMTP();
  3. $mail->Host = SMTP_HOST;
  4. $mail->Port = 465;
  5. //$mail->SMTPDebug = 2;
  6. $mail->SMTPDebug = false;
  7. $mail->SMTPSecure = 'ssl';
  8. $mail->SMTPAuth = true;
  9. $mail->Username = SMTP_USERNAME;
  10. $mail->Password = SMTP_PASSWORD;
  11. $mail->AddAddress($_POST['email'],"Main Recipient");
  12.  
  13.  
  14.  
  15.  
  16.  
  17. $mail->SetFrom("do-not-reply@cxxxxx.xx.xx", "xxxxx Email");
  18. $mail->Subject = ('Enquiry of '.$_POST['firstName'].' From website');
  19.  
  20. if($displayData["location"])
  21. $mail->AddAttachment($displayData["location"], $displayData["filename"]);
  22. $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
  23. $mail->Body = $message;
  24. $mail->MsgHTML($mail->Body);
  25.  
  26.  
  27. if(!$mail->Send()){
  28. return 0;
  29. } else{
  30. return 1;
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement