Hola.
Tengo el siguiente codigo, que si funciona pero no lo hace como debiera.
Quiero mostrar la pagina principal de google en el cuerpo de un mail.
Pero solo me muestra el codigo fuente, ¿que estoy haciendo mal?
Aquí mi codigo:
[HTML]
<?php
include('class.smtp.inc');
header('Content-Type: text/plain');
$hoy = date ("d F Y");
//$message = "\t\t\t$hoy\n\n";
$filename='http://www.google.com';
$s=file_get_contents($filename);
$message = $s;
echo $s;
$params['host'] = 'smtp.humantraining.com.mx';
$params['port'] = 25;
$params['helo'] = 'humantraining.com.mx';
$params['auth'] = TRUE;
$params['user'] = '
[email protected]';
$params['pass'] = '******';
$send_params['recipients'] = array('
[email protected]','sandy15rm @yahoo.com'); // The recipients (can be multiple), separados por coma.
$send_params['headers'] = array(
'From: "
[email protected]" <
[email protected]>',// Headers
'To:
[email protected],
[email protected] m', 'Subject: Correo de Comentarios'
);
$send_params['from'] = '
[email protected]'; // This is used as in the MAIL FROM: cmd
// It should end up as the Return-Path: header
$send_params['body'] = $message; //Message // The body of the email
if(is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params)){
Header("Location: http://www.humantraining.com.mx/ok.htm");
exit;
// Any recipients that failed (relaying denied for example) will be logged in the errors variable.
//print_r($smtp->errors);
}else{
Header("Location: http://www.humantraining.com.mx/bad.htm");
exit;
// The reason for failure should be in the errors variable
//print_r($smtp->errors);
}
?>
Gracias