PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
adding images to an html but not attachment

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
erwandrd



Joined: 08 Feb 2008
Posts: 1

PostPosted: Fri Feb 08, 2008 1:46 pm    Post subject: adding images to an html but not attachment Reply with quote

Dear new friends from the Pear Forum world family,

I ain't no expert in using Pear Mail but I'm slowly getting the grips of it but there's one or two little things that are doing my wee little head in.

I want to send html email using Mail_mime and add images to it (who wouldn't?!) and it works!!
My concern is that I don't want these images to appear as attachments as they do at the moment.. although I learned from a tutorial that it shouldn't happen.

Is it possible or am I the victim of a big white lie?

here's my piece of kit:


include('Mail.php');
include('Mail\mime.php');

$message = new Mail_mime();
$text = file_get_contents("mail_folder/mail_text.txt");
$html = file_get_contents("mail_folder/mail_html.html");
$imagem = file_get_contents("mail_folder/R2D2.gif");
$logo = file_get_contents("mail_folder/logo_mail.gif");


$message->setTXTBody($text);
$message->setHTMLBody($html);
$message->addHTMLImage($imagem,"image/jpeg","R2D2.gif",false);
$message->addHTMLImage($logo,"image/gif","logo_mail.gif",false);

$body = $message->get();
$extraheaders = array("From"=>"R1 <rone@yahoo.com>", "Subject"=>$_POST[subject]);
$headers = $message->headers($extraheaders);

$mail = Mail::factory("mail");
$mail->send($line[email_addr], $headers, $body);

My second question is: Is this the best way of sending a News letter, knowing that the codes above are used in a while loop for each subscribers.

Thank you for any help.

Ta ra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software