# PHP mail

**URL:** <https://forum.kirupa.com/t/php-mail/330731>\
**Category:** Uncategorized\
**Created:** [March 7, 2013, 10:23am UTC](https://forum.kirupa.com/t/php-mail/330731 "2013-03-07T10:23:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnab\_Dutta](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Arnab\_Dutta](https://forum.kirupa.com/u/Arnab_Dutta)\
**Post date:** [March 7, 2013, 10:23am UTC](https://forum.kirupa.com/t/php-mail/330731/1 "2013-03-07T10:23:26Z")

</div>

I am using the below code for my feedback form:-  
\<?  
$fname = $\_REQUEST[‘fname’] ;  
$femail = $\_REQUEST[‘femail’] ;  
$fphone = $\_REQUEST[‘fphone’] ;  
$fsubject = $\_REQUEST[‘fsubject’] ;  
$message = $\_REQUEST[‘message’] ;  
require(“class.phpmailer.php”);  
$mail = new PHPMailer();  
$mail-\>IsSMTP(); // send via SMTP  
$mail-\>Host = “[mail.myweb.org](http://mail.myweb.org)”; // SMTP server  
$mail-\>SMTPAuth = true; // turn on SMTP authentication

$mail-\>Username = “[myweb.org](http://myweb.org)”; // SMTP username  
$mail-\>Password = “pass”; // SMTP password

$mail-\>From = $femail; // visitor/ sender email id  
$mail-\>FromName = $fname; // visitor/ sender name  
$mail-\>AddAddress("arnab.loknath@gmail.com",“Arnab”); // Write receipnt address here  
//$mail-\>AddReplyTo("arnab.loknath@gmail.com",“Arnab”);  
$mail-\>WordWrap = 50; // set word wrap  
//$mail-\>AddAttachment("Path to Attachment "); // attachment  
$mail-\>IsHTML(true); // send as HTML  
$mail-\>Subject = “Contact mail to [myweb.org](http://myweb.org)”; // mail subject  
$mail-\>Body = “\<b\>Mail Body:\<br\>\</b\>”.$comments; // mail body as html  
//$mail-\>AltBody = “This is the text-only body”;  
if(!$mail-\>Send())  
{  
echo “Message was not sent \<p\>”;  
echo "Mailer Error: " . $mail-\>ErrorInfo;  
exit;  
}  
echo “Thank you,we will contact you within 24 hours.”;  
?\>

Plz help me to find out the problem
