Guest User

Untitled

a guest
Dec 14th, 2017
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. $fromName = $_POST['username'];
  2. $fromEmail = $_POST['email'];
  3. $theMessage = $_POST['message'];
  4. $theSubject = $_POST['subject'];
  5.  
  6. $mail = new PHPMailer;
  7.  
  8. $mail->isSMTP();
  9. $mail->Host = 'smtp.hosts.co';
  10. $mail->SMTPAuth = true;
  11. $mail->Username = 'username';
  12. $mail->Password = '.........';
  13.  
  14. $mail->From = 'person@ourcompany.com';
  15. $mail->FromName = 'ourcompany';
  16. $mail->addAddress('support@ourcompany.com', 'ourcompany');
  17. $mail->addReplyTo($fromEmail, $fromName);
  18.  
  19. $mail->Subject = $theSubject;
  20. $mail->Body = "<p>You have got a email from <b>{$fromName}<{$fromEmail}></b></p>";
  21. $mail->Body .= "<p><b>The actual message is given bellow</b></p>";
  22. $mail->Body .= "<p>";
  23. $mail->Body .= nl2br($theMessage);
  24. $mail->Body .= "</p>";
  25.  
  26. $mail->From = 'person@ourcompany.com';
  27.  
  28. $fromName = $_POST['username'];
  29.  
  30. You have got a email from sendername<sender@gmail.com>
  31. The actual message is given bellow
  32. Hi,.........................
Add Comment
Please, Sign In to add comment