Hi naval thanks for replying,
It's working perfect now with the PHPmailer, except for the fact that all the returns on the text are not showing on the other side (at least at Microsoft Outlook).
It seems like the PHPmailer class has "eaten" the "\n" that I've put at the $message variable.
This is the code:
PHP Code:
require("phpmailer/class.phpmailer.php");
#
$mail = new PHPMailer();
#
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "localhost"; // SMTP server
#
include("include/email_body.php");
#
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "lusopipe+crmpt.com"; // SMTP username
$mail->Password = "------"; // SMTP password
#
$meu_email2 = 'lusopipe@crmpt.com';
$mail->From = $meu_email2;
$mail->FromName = "my".$companyname;
#
$mail->AddAddress("$email_a_enviar");
$mail->AddAddress("$p_emladm_parametro"); // name is optional
#
$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML (i also tried the false word but still nothing...
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = $message;
#
if(!$mail->Send()) {
echo("<script>window.alert('EMAIL NOT SEND ...ERROR: ".$mail->ErrorInfo."!')</script>");
}
Also the include email_body:
PHP Code:
$subject = "Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla ";
$message = "AUTOMATIC EMAIL:\n";
$message .= "\nComercial: $scr_nome_vendedor,\n";
$message .= "\nFez a sua entrada N. ";
$message .= $visitas_totais;
$message .= " em MyLusopipe, a entidade com os seguintes dados:\n";
$message .= "\nNome da Entidade: $scr_nome_entidade";
$message .= "\nPessoa de Contacto: $scr_con0_entidade";
$message .= "\nTelemovel Contacto: $scr_tlmv0_entidade\n";
$message .= "\n$minha_empresa\n";
As You can see there are a lot of \n that theoretically should insert a CR on the line, instead everything is appearing at the email on M.Outlook on the same line. It's very confusing to read.
I will keep on making more experiences, but in the meanwhile if there is something that You can immediately see under Your experienced programmer eyes, that could solve this issue, I would very much appreciate all the help.
Thanks,
pipesportugal