HTML Mailing - with images?

Hey, I’m currently working on a simple script for a client that sends a PHP Mail to an e-mail address. On my linked HTML page, there are fields for To, From, Subject, and Message.

My client requested that the message field be HTML-compatible. I have gotten the script to produce and send HTML-formatted e-mails, but the one thing that does not work is images. I have tried everything.

Take a look at my script here:

$to = $_POST[‘to’];
$subject = $_POST[‘subject’];
$from = $_POST[‘from’];
$message = $_POST[‘htmlmsg’];

$headers = ‘MIME-Version: 1.0’ . “rn”;
$headers .= ‘Content-type: text/css; charset=iso-8859-1’ . “rn”;

$headers .= 'From: ’ . $from . “n”;

$sent =
mail($to, $subject, $message, $headers) ;


{print ‘

Your HTML message was sent successfully.’; }


{print “An error occurred and your message was not sent.”; }


When I use IMG or EMBED tags in my message box and send the message, the images always show up broken. What am I doing wrong? (Very new to PHP)

Any help is appreciated, thanks much.

**Mod Edit added php bbcode tags for readability.

You are going to have to write a script that allows for attachments.

Then when an image is used the user can attach the file.

Sponsor our Newsletter | Privacy Policy | Terms of Service