Hi,
I'm trying to send an image as an attachment using php (via flash) and mail() and i'm getting stuck. I know its possible I think its just my syntax thats wrong. Heres the code I have so far:
<?php
$separator = "\r\n";
$image = <img src="Hype1.jpg">;
$message = "<html><body>"$image"</body></html>" . $separator; //PROBLEM!
$subject=$POST['sender_name']." has sent you a picture from www.hypedafunk.co.uk!";
$subject = wordwrap($subject, 70);
$to = $POST['email_address'];
$to = wordwrap($to, 70);
$headers .= 'From: HypeDaFunk <info@hypedafunk.co.uk>'.$eol;
$headers .= 'Reply-To: HypeDaFunk <info@hypedafunk.co.uk>'.$eol;
$headers .= 'Return-Path: HypeDaFunk <info@hypedafunk.co.uk>'.$eol;
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html;charset=ISO-8859-9\n";
$headers .= "X-Priority: 1\n";
$headers .= "Importance: High\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP v".phpversion().$eol;
mail($to, $subject, $message, $headers);
?>
The email sends fine when the img src line is substituted with text so I know that its that line thats the problem with the code. I'd really appreciate someone to tell me what I'm doing wrong.
Many thanks,
Graham