Guest User

Untitled

a guest
Mar 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. use PHPMailerPHPMailerPHPMailer; (line 3)
  2. use PHPMailerPHPMailerException; (line 4)
  3.  
  4.  
  5. Error: parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '('email.php on line 3
  6.  
  7. <?php
  8.  
  9. use PHPMailerPHPMailerPHPMailer;
  10. use PHPMailerPHPMailerException;
  11. function sendemail(){
  12.  
  13.  
  14.  
  15. require '../mail/src/PHPMailer.php';
  16. require '../mail/src/SMTP.php';
  17.  
  18. $mail = new PHPMailer(true); // Passing `true` enables exceptions
  19. try {
  20. include "removed(was database)";
  21. $name = $_POST['name'];
  22. $Uemail = $_POST['email'];
  23. $select = $_POST['select'];
  24. $issue = $_POST['issue'];
  25. $resolution = $_POST['resolution'];
  26. $datesubmited = date("Y-m-d H:i:s");
  27. //Server settings
  28. $mail->SMTPDebug = 4; //1-4 // Enable verbose debug output
  29. $mail->isSMTP(); // Set mailer to use SMTP
  30. $mail->Host = 'removed'; // Specify main and backup SMTP servers
  31. $mail->SMTPAuth = true; // Enable SMTP authentication
  32. $mail->Username = 'removed'; // SMTP username
  33. $mail->Password = 'removed'; // SMTP password
  34. $mail->SMTPSecure = ''; // Enable TLS encryption, `ssl` also accepted
  35. $mail->Port = removed; // TCP port to connect to
  36.  
  37. //Recipients
  38. $email = 'removed'; //put in default email that corresponds with the username / passwoard.
  39. $mail->setFrom( $email, 'removed');
  40. $mail->addAddress($Uemail, $name);
  41. $mail->addAddress('removed', 'removed');
  42. $mail->addAddress('removed', 'removed'); // Add a recipient
  43. // $mail->addAddress('', $name);
  44.  
  45.  
  46. //Attachments
  47. // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  48. // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  49.  
  50. //Content
  51. $mail->isHTML(true); // Set email format to HTML
  52. $mail->Subject = 'Request from ' . $name;
  53. $mail->Body = 'Details ' . "<br>" .
  54. "Date: " . $datesubmited . "<br>" .
  55. "Name: " . $name . "<br>" .
  56. "Email Address: " . $email . "<br>" .
  57. "Area of Concern: " . $select . "<br>" .
  58. "Issue: " . $issue . "<br>" .
  59. "Suggested Resolution: " . $resolution . "<br>";
  60.  
  61.  
  62.  
  63.  
  64. $mail->AltBody = 'Hello '. $name . ' your request has been sumbited!'.'</b>';
  65. $mail->SMTPOptions = array(
  66. 'ssl' => array(
  67. 'verify_peer' => false,
  68. 'verify_peer_name' => false,
  69. 'allow_self_signed' => true
  70. )
  71. );
  72. $mail->send();
  73. echo "Thank you " . $name . " for your submission." . "<br>" . "Someone will repsond to you shortly.";
  74. echo "<br>";
  75. echo "Go back home " . "removed" ;
  76. } catch (Exception $e) {
  77. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  78. }
  79. }
  80.  
  81.  
  82.  
  83.  
  84. ?>
Add Comment
Please, Sign In to add comment