Reply to Re: images within email

Your name:

Reply:


Posted by noodles on 01/23/06 16:36

<SNIP>
>
> So - do you have a pointer for me. I would rather write the code myself
> it cant be that hard !!
>>

If you've sucessuflly sent an HTML message just use the HTML img tages to
insert the image, as you would with a webpage. See below for a snippet of
code taken from http://uk2.php.net/mail that should help.


<?php

@set_time_limit(0);

require_once 'smtp_mail.php';

$to = "expertphp@yahoo.com";
$from = "from@myaccount.com";
$subject = "Subject here";

$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/html; charset=iso-8859-1\r\n".
"From: \"My Name\" <".$from.">\r\n".
"To: \"Client\" <".$to.">\r\n".
"Date: ".date("r")."\r\n".
"Subject: ".$subject."\r\n";

$message = "
<html>
<body>
<b>html message</b><br>
<font color=\"red\">here</font>
<img src=\"http://static.php.net/www.php.net/images/php.gif\"
border=\"0\" alt=\"\">
</body>
</html>
";

$response = smtp_mail($to, $subject, $message, $from, $headers);

if($response[0]) echo "The message has been sent !<br />\n".$response[1];
else echo "The message can not been sent !<br />\n".$response[1];

?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация