i want to send mail to the client from my site. i am using php sendmail() to send mail. following is my code :-
<?php
include('Connection.php');
include 'smtp/Send_Mail.php';
if(isset($_POST['submit']))
{
$name = $_POST['userName'];
$mob = $_POST['mobileNo'];
$email = $_POST['emailId'];
$fed = $_POST['feedback'];
$_SESSION['unm']=$name;
$_SESSION['mbl']=$mob;
$_SESSION['eml']=$email;
$_SESSION['fdbk']=$fed;
$sql=" Call addUser('$name','$email','$mob','$fed')";
$result = mysql_query($sql);
$to=$email;
$subject="Thank you for getting in touch.";
$body=' <h1 style="color:blue;"> Dear '. $name.', </h1> <br/>
Thank you for getting in touch';
Send_Mail($to,$subject,$body);
}
?>
and the Send_Mail.php file look like this:
<?php
function Send_Mail($to,$subject,$body)
{
require 'class.phpmailer.php';
$from = "ashmeerafurnishingxxx@gmail.com";
$mail = new PHPMailer();
$mail->IsSMTP(true); // use SMTP
$mail->IsHTML(true);
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "tls://smtp.gmail.com"; // Amazon SES server, note "tls://" protocol
$mail->Port = 465; // set the SMTP port
$mail->Username = "ashmeerafurnishingxxx@gmail.com"; // SMTP username
$mail->Password = "xxxxxxx"; // SMTP password
$mail->SetFrom($from, 'Ashmeera Furnishing Decor');
$mail->AddReplyTo($from,'Ashmeera Furnishing Decor');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
$mail->Send();
}
?>
Its working on localhost bt when i upload the same code on server then the mail was not send. any configuration settings change required or anything else. need help .. thank in advance.