Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/06/2005, 14:52
Avatar de radarcba
radarcba
 
Fecha de Ingreso: mayo-2005
Ubicación: ureleando
Mensajes: 505
Antigüedad: 18 años, 11 meses
Puntos: 3
Pregunta clase grabURL . enviar html por mail

Estoy armando un envio de imagenes y encontre una clase que se llama grabURL:
<?
// this script will grab yahoo.com and send it in your mailbox
include("grabUrl.php");
$foo=new grabUrl();
$foo->createTo("[email protected]");
$foo->createCC("[email protected]");
$foo->createBCC("[email protected]");
$foo->createFrom("Fred Dust","[email protected]");
$foo->createSubject("This is a test mail! Please Ignore!");
$foo->getData("http://www.yahoo.com");
if($foo->sendMail()){
echo "Mail Sent!";
}else{
echo "Error Sending Mail!";
}
?>
cuando la pruebo con yahoo llega bien, pero cuando le pongo la ruta a mi html
el mesaje llega pero no la imagen, ??? .
Ayudas seran bienvenidas. Gracias.
ahh . la clase
<?php
class grabUrl{
var $toEmail="";
var $mailSubject="";
var $mailHeaders="";
var $addHeaders="";
var $grabData="";

function createTo($email){
$this->toEmail=$email;
}

function createCC($email){
$this->mailHeaders.="Cc: $email\r\n";
}

function createBCC($email){
$this->mailHeaders.="Bcc: $email\r\n";
}

function createSubject($sub){
$this->mailSubject=$sub;
}

function createFrom($name,$email){
$this->mailHeaders.="From: '$name' <$email>\r\n";
}

function sendMail($charset="iso-8859-1"){
$this->mailHeaders.="MIME-Version: 1.0\r\n";
$this->mailHeaders.="Content-type: text/html; charset=$charset\r\n"; // alternate is utf-8
if(mail($this->toEmail,$this->mailSubject,$this->grabData,$this->mailHeaders)){
return true;
}else{
return false;
}
}

function getData($url,$use_include_path=0){
$file = @fopen($url, 'rb', $use_include_path);
if ($file){
if ($fsize = @filesize($filename)){
$data = fread($file, $fsize);
}else{
while (!feof($file)){
$data .= fread($file, 1024);
}
}
fclose($file);
}
$this->grabData=$data;
}

function showPage(){
echo $this->grabData;
}

function returnData(){
return $this->grabData;
}


}

/*
Sample Usage
*/

/*
$foo=new grabUrl();
$foo->createTo("[email protected]");
$foo->createCC("[email protected]");
$foo->createBCC("xxx.www.com");
$foo->createFrom("Vedanta Barooah","[email protected]");
$foo->createSubject("This is a test mail! Please Ignore!");
$foo->getData("http://www.bbc.co.uk");
if($foo->sendMail()){
echo "Mail Sent!";
}else{
echo "Error Sending Mail!";
}
*/
?>
__________________
Maldición va a ser un día hermoso... PR
Tetris, correo & TU IP