Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailerAutoload.php';
- $contactEmail = $_POST['Email'];
- $contactName = $_POST['Name'];
- $contactNumber = $_POST['Cell'];
- $contactLocation = $_POST['Location'];
- $contactMessage = $_POST['Message'];
- $mail = new PHPMailer(true);
- $mail->isSMTP();
- $mail->SMTPDebug = 2;
- $mail->SMTPKeepAlive = true;
- $mail->Mailer = “smtp”;
- $mail->Host = 'smtp.lovecharmking.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'xxxx';
- $mail->Password = 'xxx';
- $mail->SMTPSecure = 'TLS';
- $mail->Port = 587;
- $mail->setFrom('help@lovecharmking.com', $contactName);
- $mail->addAddress('papazeddy@gmail.com', 'Zeddy');
- $mail->addReplyTo($contactEmail);
- $mail->isHTML(true);
- $email_body = "";
- $email_body .= "<b>Name: </b> " . $contactName . "</span>";
- $email_body .= "<b>Email Address: </b>" . $contactEmail . "</b";
- $email_body .= "<p>Phone Number: " . $contactNumber . "</p>";
- $email_body .= "<p><b>Location: </b>" . $contactLocation . "</p>";
- $email_body .= "<p><b>Message: </b>" . $contactMessage . "</p>";
- $mail->Subject = 'Contact Form';
- $mail->Body = $email_body;
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
Add Comment
Please, Sign In to add comment