Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use PHPMailerPHPMailerPHPMailer; (line 3)
- use PHPMailerPHPMailerException; (line 4)
- Error: parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '('email.php on line 3
- <?php
- use PHPMailerPHPMailerPHPMailer;
- use PHPMailerPHPMailerException;
- function sendemail(){
- require '../mail/src/PHPMailer.php';
- require '../mail/src/SMTP.php';
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- include "removed(was database)";
- $name = $_POST['name'];
- $Uemail = $_POST['email'];
- $select = $_POST['select'];
- $issue = $_POST['issue'];
- $resolution = $_POST['resolution'];
- $datesubmited = date("Y-m-d H:i:s");
- //Server settings
- $mail->SMTPDebug = 4; //1-4 // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'removed'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'removed'; // SMTP username
- $mail->Password = 'removed'; // SMTP password
- $mail->SMTPSecure = ''; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = removed; // TCP port to connect to
- //Recipients
- $email = 'removed'; //put in default email that corresponds with the username / passwoard.
- $mail->setFrom( $email, 'removed');
- $mail->addAddress($Uemail, $name);
- $mail->addAddress('removed', 'removed');
- $mail->addAddress('removed', 'removed'); // Add a recipient
- // $mail->addAddress('', $name);
- //Attachments
- // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Request from ' . $name;
- $mail->Body = 'Details ' . "<br>" .
- "Date: " . $datesubmited . "<br>" .
- "Name: " . $name . "<br>" .
- "Email Address: " . $email . "<br>" .
- "Area of Concern: " . $select . "<br>" .
- "Issue: " . $issue . "<br>" .
- "Suggested Resolution: " . $resolution . "<br>";
- $mail->AltBody = 'Hello '. $name . ' your request has been sumbited!'.'</b>';
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- $mail->send();
- echo "Thank you " . $name . " for your submission." . "<br>" . "Someone will repsond to you shortly.";
- echo "<br>";
- echo "Go back home " . "removed" ;
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment