Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'class.phpmailer.php';
- if(isset($_POST['submit']))
- {
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->Host = 'webmail.example.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = 'digital';
- $mail->Password = '*******';
- $mail->setFrom('digital@example.com', 'example');
- $mail->addReplyTo('sales@example.com', 'example');
- $mail->addAddress('sales@example.com', 'example');
- $name_field = $_POST['name'];
- $mobile_field = $_POST['mobile'];
- $project_field = $_POST['project'];
- $utm_source_field = $_POST['USOURCE'];
- $utm_medium_field = $_POST['UMEDIUM'];
- $utm_campaign_field = $_POST['UCAMPAIGN'];
- $mail->Subject = "Website Inquiry - $project_field";
- $mail->msgHTML($body);
- if (!$mail->send()) {
- $error = "Mailer Error: " . $mail->ErrorInfo;
- ?><script>alert('<?php echo $error ?>');</script><?php
- }
- else {
- echo '';
- header("Location: thankyou.html");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement