· 10 years ago · May 26, 2016, 05:18 AM
1<?php
2$name=$_POST['Your_Name'];
3$email=$_POST['Your_Email'];
4$message=$_POST['Your_Add'];
5echo $name ;
6
7// When we unzipped PHPMailer, it unzipped to
8// public_html/PHPMailer_5.2.0
9require("mailer/PHPMailerAutoload.php");
10require("mailer/class.smtp.php");
11require("mailer/class.phpmailer.php");
12
13$mail = new PHPMailer();
14
15// set mailer to use SMTP
16$mail->IsSMTP();
17
18// we are setting the HOST to localhost
19$mail->Host = "mail.soumitrapendse.com"; // specify main and backup server
20$mail->SMTPAuth = true; // turn on SMTP authentication
21
22$mail->Username = "*****@gmail.com"; // SMTP username
23$mail->Password = "******"; // SMTP password
24
25$mail->From = $email;
26
27// below we want to set the email address we will be sending our email to.
28$mail->AddAddress("***@gmail.com", "AAA");
29
30// set word wrap to 50 characters
31$mail->WordWrap = 50;
32// set email format to HTML
33$mail->IsHTML(true);
34
35$mail->Subject = "You have received feedback from your website!";
36
37// $message is the user's message they typed in
38// on our contact us page. We set this variable at
39// the top of this page with:
40// $message = $_REQUEST['message'] ;
41$mail->Body = $message;
42$mail->AltBody ="Name : {$name}nnEmail : {$email}nnMessage : {$message}";
43
44if(!$mail->Send())
45{
46echo "Message could not be sent. <p>";
47echo "Mailer Error: " . $mail->ErrorInfo;
48exit;
49}
50else
51{
52echo "Thank you for contacting us. We will be in touch with you very soon.";
53}
54?>