 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
erwandrd
Joined: 08 Feb 2008 Posts: 1
|
Posted: Fri Feb 08, 2008 1:46 pm Post subject: adding images to an html but not attachment |
|
|
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 |
|
 |
|
|
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
|
|