Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name= $_REQUEST['name'] ;
- $email= $_REQUEST['email'] ;
- $comments= $_REQUEST['comments'] ;
- require("/home/uparw/public_html/demo6/14/PHPMailer-master/class.phpmailer.php");
- $mail = new PHPMailer;
- // For Useing Domian mail
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->SMTPDebug = 0;
- $mail->Host = 'localhost'; // Specify main and backup server
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'ali@uparw.com'; // SMTP username
- $mail->Password = 'password'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- // For Gmail
- //$mail->SMTPAuth = true; // authentication enabled
- //$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
- //$mail->Host = "smtp.gmail.com";
- //$mail->Port = 465; // or 587
- //$mail->IsHTML(true);
- //$mail->Username = "aliuparrow@gmail.com";
- //$mail->Password = "password";
- $mail->From = 'ali@uparw.com';
- $mail->FromName = $name;
- $mail->addAddress('alisiddique2011@gmail.com', 'Ali Siddique'); // Add a recipient
- //$mail->addAddress('alisiddique2011@gmail.com'); // Name is optional
- //$mail->addReplyTo('alisiddique2011@gmail.com', 'Ali');
- //$mail->addCC('cc@example.com');
- //$mail->addBCC('bcc@example.com');
- //$mail->WordWrap = 50; // Set word wrap to 50 characters
- //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Query From healthjourney ';
- $mail->Body = 'Email: ' . $email . '<br />' . 'Comment: ' . $comments;
- $mail->AltBody = 'Email: ' . $email . '<br />' . 'Comment: ' . $comments;
- //if(!$mail->send()) {
- //echo 'Message could not be sent.';
- //echo 'Mailer Error: ' . $mail->ErrorInfo;
- // exit;
- //}
- $output = '';
- if(!$mail->Send())
- {
- $output .= "Mailer Error: ". $mail->ErrorInfo;
- }
- else
- {
- ob_clean();
- header('Location: thankyou.html');
- exit();
- }
- echo $output;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement