views:

678

answers:

4

Hi, i would like to send html email with graphic elements included i have no idea to attach garaphics to this email please help

+3  A: 

I'm not going to bore you with a mediocre explanation here so instead let me link to this great tutorial over at Sitepoint which explained it to me in plain english! - sitepoint.com/article/advanced-email-php/

J-P
+5  A: 

You probably don't want to do an inline attachment by hand, it's far easier, and less error prone to use a library, like PHPMailer.
It can attach the inline images, or if you give it some HTML code, it will attach the images by itself and modify the code to display them.

Zsolt Sz.
+4  A: 

You can try Swift Mailer

Gaurav
+2  A: 

The short version is that you are probably best off creating a HTML formatted messages, and using the header parameter of the php mail function.

 $headers = "From: [email protected]\n" .
    "MIME-Version: 1.0\n" .
    "Content-type: text/html; charset=iso-8859-1";
 mail([email protected], 'subject line', 'your message text <strong>with HTML in it</strong>', $headers);

The sitepoint.com article referenced by Jimmy provides an excellent and complete description of your options.

acrosman