I have a faced this problem when i was integrating SMTP mail for first time. Then after lots of attempt i got success in sending form value with variable in msgHTML(). Therefore, I thought to share this successful attempt with all programmers. I have shown below how to send variable in msgHTML().
Let us see below::
1) Rreplace $mail->msgHTML($msg) with the body function :
as I have written this code below:
$mail->IsHTML(true);
$mail->Body='Name: '.$_POST['name'].'<br />
Email: '.$_POST['email'].'<br />
Sujet: '.$_POST['subject'].'
<br /><br />
'.nl2br($_POST['msg']).'
<br /><br /> ;
$mail->Send();
solution of when variable value is not passed into //$mail->MsgHTML('');
Let us see below::
1) Rreplace $mail->msgHTML($msg) with the body function :
as I have written this code below:
$mail->IsHTML(true);
$mail->Body='Name: '.$_POST['name'].'<br />
Email: '.$_POST['email'].'<br />
Sujet: '.$_POST['subject'].'
<br /><br />
'.nl2br($_POST['msg']).'
<br /><br /> ;
$mail->Send();
solution of when variable value is not passed into //$mail->MsgHTML('');
No comments:
Post a Comment