Hola chicos, tengo un problemilla, estoy usando phpmailer y deseo enviar e-mails pero en texto sin formato( no html ) estoy usando la función para llamar archivos html para poder adecuar mis plantillas de e-mail, les copio mi código:
Código PHP:
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = file_get_contents('templates/content.html');
$body = eregi_replace("[\]",'',$body);
$body = str_replace('[ipaddress]',$ipaddress,$body);
$body = str_replace('[port]',$port,$body);
$body = str_replace('[hostname]',$hostname,$body);
$body = str_replace('[password]',$password,$body);
$body = str_replace('[agent]',$agent,$body);
$mail->AddReplyTo("[email protected]","Human");
$mail->SetFrom("[email protected]", "Human");
$address = "[email protected]";
$mail->AddAddress($address, $agent);
$mail->Subject = "Subject message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
y en mi plantilla tengo lo siguiente:
Código:
Hello, we have any problems with one of our servers, below i show the server details:<br /><br />
<strong>Ip address:</strong> [ipaddress]/n
<strong>Ports affected:</strong> [port]<br />
<strong>Hostname:</strong> [hostname]<br />
<strong>Root password:</strong> [password]<br /><br />
Please check who can be the problem.<br /><br />
Thank you, regards.<br />
[agent]
Podrían ayudarme de como proceder? se los agradecería mucho.
Un saludo y gracias de antemano.