Click to See Complete Forum and Search --> : Adding an image to a non html email


Anon
11-16-2000, 08:18 AM
Hi All

A small problem here

How do i send an email that contains an image in it. I don't mean sending an HTML (which requires the installation of the relevant class)email but a normal text email.

I'd like to be able to include an html link to an image on my server. That way i won't have to embed the image in the emai but just provide a path for the image to be grabbed from.


Here's what i've got at the moment

$to = "me@mycompany.com";
$subject = "Test mail";

## THIS SETS THE REQURED HEADERS ##

$header = "Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=\"============_newsletter==============\"";

## BODY OF THE MAIL IN TWO FORMATS ##

$body = "--============_newsletter==============
Content-Type: text/html; charset=\"iso-8859-1\" ; format=\"flowed\"
Content-Transfer-Encoding: quoted-printable

plain

--============_newsletter==============
Content-Type: text/html; charset=\"iso-8859-1\"
Content-Transfer-Encoding: quoted-printable

<!doctype html public \"-//W3C//DTD W3 HTML//EN\">
<head><title>This is a test html email</title></head><body>

<img src=3D\"http://www.foodndrink.co.uk/images/features/isolafood.gif\" align=3D\"right\" hspace=3D\"10\">

</body>


--============_newsletter==============--";

mail($to, $subject, $body, $header);

print "done...";

?>

All i get is an email with the word plain. Anyone got any help for me ?

Many thanks in anticipation

Gary Mailer