Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'phpmailer.php';
- if (array_key_exists('name', $_POST)) {
- $name = substr(strip_tags($_POST['name']), 0, 255);
- } else {
- $name = '';
- }
- $email = $_POST['email'];
- $message = $_POST['message'];
- $mail -> new PHPMailer;
- $mail->isSMTP();
- $mail->SMTPSecure = 'ssl';
- $mail->Host = 'om-travel.com';
- $mail->SMTPDebug = 2;
- $mail->Port = 465;
- $mail->SMTPAuth = true;
- $mail->Username = "tester@om-travel.com"; //user email
- $mail->Password = "blabla"; //password email
- $mail->CharSet = 'utf-8';
- $mail->setFrom('tester@om-travel.com', "OMTravel");
- $mail->addAddress('davenathanaeld@gmail.com');
- $mail->addReplyTo($email, $name);
- $mail->Subject = 'Contact from : ' . $name . '(' . $email . ')';
- $mail->Body = "Contact form submission\n\n" . $message;
- if (!$mail->send()) {
- $msg .= "Mailer Error: " . $mail->ErrorInfo;
- } else {
- $msg .= "Message sent!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement