Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- require __DIR__.'/PHPMailer.php';
- require __DIR__.'/SMTP.php';
- require __DIR__.'/Exception.php';
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = "lion.asianbookone.com";
- $mail->Port = 587;
- $mail->Username = "noble";
- $mail->Password = "N0b1l*23";
- $email_to = "melissayao@comcast.net";
- $email_subject = "test this out";
- $email_message = "test";
- function died($error) {
- echo "We are very sorry, but there were error(s) found with the form you submitted. ";
- echo "These errors appear below.<br /><br />";
- echo $error."<br /><br />";
- echo "Please go back and fix these errors.<br /><br />";
- die();
- }
- // create email headers
- $mail->SetFrom('nobleplaces@nobleplaces.com', 'Application Form');
- $mail->Subject = $email_subject;
- $mail->MsgHTML($email_message);
- $mail->AddAddress($email_to, 'Melissa Yao');
- if ($mail->Send()) {
- ?>
- <div class="success-mes">
- <div class="text-block">Thank you! Your submission has been received! You may now close this window.</div>
- </div>
- <?php
- } else {
- ?>
- <div class="fail-mes">
- <div class="text-block">We're sorry! We're currently undergoing server maintenance. Please try again at a later time.</div>
- </div>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement