i send email with PHPMailer, my code is:
$mail = new PHPMailer(true);
$mail->Mailer = "smtp";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = 0;
$mail->SMTPSecure = 'tls';
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->Username = "nati323@gmail.com";
$mail->Password = "****";
$mail->addCustomHeader('Content-Type: text/plain; charset="utf-8"');
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->From = $from;
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $msg;
return $mail->Send();
the $msg variable is a function parameter i use it like this:
function sendMail ($to, $subject, $msg, $from, $add = null)
and i use it like this:
sendMail($_POST['mail'], $text['EMAIL_RECOVER_MSG_SUBJECT'], $text['EMAIL_RECOVER_MSG'], $from)
the variables contain:
$text['EMAIL_RECOVER_MSG_SUBJECT'] = 'Password Recover: From dmworld24.com';
$text['EMAIL_RECOVER_MSG'] = 'You Forget Your Password To Recover it Please Go Into The Next Link:\r\n http://dmworld24.com/login.php?act=rec&token={TOKEN}&mail={MAIL} \r\n If You Didnt Ask For Password Recovering Just Ignore This Message';
$from = 'System@dmworld24.com';
now i try to add line break to message for example:
You Forget Your Password To Recover it Please Go Into The Next Link:\r\n http://dmworld24.com/login.php?act=rec&token=7054343021*****353214&mail=nati323@gmail.com \r\n If You Didnt Ask For Password Recovering Just Ignore This Message
and what i get in the mail is the same, the \r\n shows as chars and there is not line breaks, what i did wrong?
another problem that i have, that the form method dosent work, i send email for try to nati323@gmail.com , and i connect to smtp server with nati323@gmail.com acount, and i always get the message from my self, and the Form that i defined dosent show....