0

Hi,
i want to include images in email,i write the following script which unfortunatly not working,please any one help me resloved my issue

`$to = "example@gmail.com";
$subject = "new account created";
$body = "New account has been created
<img border=’0' src=’http://www.example.com/myimages/track.php?MID=1111&SID=2222' width=’1' height=’1'>
" ;

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: admin@gmail.com";

$neww=mail($to,$subject,$body,$headers);
`

7
Contributors
10
Replies
35
Views
5 Years
Discussion Span
Last Post by pritaeas
0

dear it give me the same result,the script not able to send image there,if you have any example please show me that

0
<?
$to = 'myemail@gmail.com';
$subject = 'test subject';
$message = 'this is <strong>html</strong> <img src="http://l.yimg.com/a/i/ww/met/yahoo_logo_in_061509.png" > message';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
echo '->'.mail($to, $subject, $message, $headers);
?>

This worked for me. But if you are giving image as a src then that image will be come loaded from live. So if you are using gmail, it will ask something like Images are not displayed. Display images below.

But if you want image as a content in email you need to take image data and add it message rather than giving url.

I use phpmalier class. It is very easy to use.

0

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
this one is not working for me. gmail is not asking for ""display images bellow"". what i have to do

0

$Image=basename($_FILES['file']['name']);
$Image=str_replace(' ','|',$Image);
$date=date('YmdHis');
$date=str_replace('%20',' ',$date);
$Image=$date.".jpg";
$tmppath="images/".$Image;

move_uploaded_file($_FILES['file']['tmp_name'],$tmppath);

0

This thread is over 2 years old. I suggest you start a new thread and clearly state what code you are using and what is not working. Be very specific and detailed.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.