Re: Strange situation when saving a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Miguel Guirao wrote:
include("evm_mailer.php"); //The class I'm using for sending e-mails, from
www.phpclasses.org

ob_start(); // Start Output Buffer functionality


//**************************************************************************
****************
function sendcorreo($from,$doc,$depto,$cuerpo){
	$simple_mailer = new EVM_Mailer(); // create new EVM_Mailer object
	$simple_mailer->set_sender("Departamento de Logística On-line
R8","email@xxxxxxxxxxx"); // set sender name and email address
	$simple_mailer->set_subject("E-mail subject"); // set the subject line of
the email
	$simple_mailer->set_message_type("html"); // text or html mime-type
	$simple_mailer->set_message($cuerpo); // set the message body of the email
message
	$simple_mailer->add_recipient("Recipient","email@xxxxxxxxxxx"); // add a
recipient to the email To: list
	$simple_mailer->add_CC($depto,$from);
	$simple_mailer->add_BCC("CC Name","email@xxxxxxxxxxx"); // add a recipient
to the email BCC: list
	$simple_mailer->add_attachment($doc,"/path/to/my/file","html"); // add the
file as an attachment
	if($depto=="CENTRAL"){
		$simple_mailer->add_CC("CC2 Name","email@xxxxxxxxxxx"); // add a recipient
to the email CC: list
	}
	$simple_mailer->send(); // send the email
}

//**************************************************************************
******************


<?php
$salida=ob_get_contents(); //I store the content to a variable string

if(($numrmagsmseq != "FALSE") or ($numrmatdmaseq != "FALSE")){
	$doc2=$rmat.".doc"; // Create file name
	$file=fopen($doc2,"w");
	fputs($file,$salida);
	fclose($file); //Store file
	sendcorreo($userdata[3],$doc2,$userdata[1],$salida); //Calle the function
to send e-mail
}
ob_end_flush();//Empty the OB and output it contents to the browser
}
?>

I'm not at all familiar with the class you're using to send the email, but what is the third parameter to add_attachment? You're setting it to html, is that right? What email client are you checking the email with? Does it allow you to view the raw email? Does it look right? If all else fails I think your best bet is to contact the author of the class.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux