Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Programming & Scripting > [SOLVED] Embed Images in php mail

Forgot Password?
 Linux Programming & Scripting   C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Closed Thread
 
Thread Tools Display Modes
Old 09-11-2007   #1 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Question [SOLVED] Embed Images in php mail

Hi all,
I'm trying to embed a single image into my php mail function.
Following the code part,when i receive the mail -image is shown as an attachment and not
embedded into the mail.

===========
//im using os commerce mailing functions,
Code:
    $message = new email(array('X-Mailer: osCommerce Mailer'));
      $image = $message->get_file("/home/oss/galleria/shoppingcart/htmls/imgEng/Logo.jpg");
      $message->add_html_image($image, 'logo');
      $message->add_html($email_text, $text);
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Lakshmipathi is offline  


Old 09-12-2007   #2 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Cool

finally , I got it
try this phpmailer instead of os commerce function
Code:
$mail = new PHPMailer();
//$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "apprelay.trc.com"; // SMTP server
$mail->From     = "lakshmipathi.g@gmail.com";
$mail->FromName = "Mailer-Today";
$mail->AddAddress("lakshmipathi.g@gmail.com"); 
$mail->WordWrap = 50;                              // set word wrap
$mail->AddEmbeddedImage("/home/oss/Logo.jpg", "my-attach", "Logo.jpg");
$mail->Body = '<img alt="PHPMailer" src="cid:my-attach">  ';
$mail->IsHTML(true);                               // send as HTML

$mail->Subject  =  "image !!!!!!!!";
$mail->AltBody  =  "This is the text-only body";

if(!$mail->Send())
{
   echo "Message was not sent <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

echo "Message has been sent";
Hope it helps somebody!!!!!!!!
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Lakshmipathi is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 02:33 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2