Advertisement
dudinmaster

wingguesthouse

Aug 28th, 2017
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2. require_once('emclass/PHPMailerAutoload.php');
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. $mail->SMTPDebug = 0;                               // Enable verbose debug output
  7.  
  8. $mail->isSMTP();                                      // Set mailer to use SMTP
  9. $mail->Host = 'mail.wingsuguesthouse.com';  // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  11. $mail->Username = 'info@wingsuguesthouse.com';                 // SMTP username
  12. $mail->Password = 'Wingsu01';                           // SMTP password
  13. $mail->SMTPSecure = 'none';                            // Enable TLS encryption, `ssl` also accepted
  14. $mail->Port = 587;                                    // TCP port to connect to
  15. $mail->SMTPAutoTLS = false;
  16. $mail->Hostname = "uvcms1.pusathosting.info";
  17.  
  18. $name = $_POST['name'];
  19. $email = $_POST['email'];
  20. $subject = $_POST['subject'];
  21. $message = $_POST['message'];
  22.  
  23. $mail->setFrom('info@wingsuguesthouse.com', 'Message from Website');
  24. $mail->addAddress('info@wingsuguesthouse.com');     // Add a recipient               // Name is optional
  25. $mail->addReplyTo($email);
  26.  
  27. $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  28. $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  29. $mail->isHTML(true);                                  // Set email format to HTML
  30.  
  31. $mail->Subject = $subject;
  32. $mail->Body    = "From: ".$name." <br> E-Mail: ".$email." <br> Subject: ".$subject." <br> Message:<br> ".$message."";
  33.  
  34. if ($_POST['submit']) {
  35.     if(!$mail->send()) {
  36.         echo 'Message could not be sent.';
  37.         echo 'Mailer Error: ' . $mail->ErrorInfo;
  38.     }else{
  39.         echo '<p>Your message has been sent! We will reply your email soon.</p>';
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement