Dear Friends!
i send image using email function and it cant show on the receiver side?? i used html script inside the massage body to send images. whats the solution?

5 Years
Discussion Span
Last Post by pzuurveen
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script src="ckeditor/sample.js" type="text/javascript"></script>
    <link href="ckeditor/sample.css" rel="stylesheet" type="text/css" />



$random_hash = md5(date('r', time())); 
$headers= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= '"\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""'; 
echo "email Send";


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>


<form id="form1" name="form1" method="post" action="">
  <table width="400" border="0" align="center">
      <td colspan="2" align="center"><strong>My Test Email</strong></td>
      <td width="103">Subject</td>
      <td width="287"><label>
        <input name="subject" type="text" id="subject" size="30" />
        <input name="to2" type="text" id="to2" size="30" maxlength="100" />
      <td><input name="from" type="text" id="from" size="30" maxlength="100" /></td>
        <textarea  id="message" name="message" rows="10"></textarea>

        <script type="text/javascript">

                // This call can be placed at any point after the
                // <textarea>, or inside a <head><script> in a
                // window.onload event handler.

                // Replace the <textarea id="editor"> with an CKEditor
                // instance, using default configurations.
                CKEDITOR.replace( 'message', {
                    extraPlugins : 'tableresize' });

      <td align="center"><label>
        <input type="submit" style="background-color:#999" name="button" id="button" value="Submit" />
        <input type="reset" style="background-color:#999" name="button2" id="button2" value="Reset" />

Edited by Nick Evan: Fixed formatting


If you can't send a picture inside the message as html.
You can only send it's URL
make sure the recverer does't get something like c:\local_user\my pictures\foto.jpg


If you can't send a picture inside the message as html.
Dear Sir!
I want to send image with html tags using text area.


Make sure that the fotolink points to the web and not to a local file


		$uid = md5(uniqid(time()));
		// headers
		$emailHeaders="From: me@me.com \r\n";
		$emailHeaders.="Reply-To: me@me.com\r\n";
		$emailHeaders.= "MIME-Version: 1.0\r\n";
   		$emailHeaders.= "Content-Type: multipart/alternative; boundary=\"".$uid."\";\r\n\r\n";
		$EmailHeaders.= "\nMIME-Version: 1.0\n Content-Type: multipart/mixed;\n boundary=\"".$uid."\"";
		// message
		$emailMessage= "--".$uid."\r\n";
		$emailMessage.= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
		$emailMessage.= "Content-Transfer-Encoding: base64\n\n";
		$html ='<html><body><table width="100%" border="2" cellspacing="2" cellpadding="2" style="border-style: double; border-bottom-width:medium;"><th colspan="2" style="font-size:large">Tiltle</th>';
		$html.="<tr><td>Foto</td><td><img src=\"".$fotolink."\" /></td></tr></table></body></html>";
		$emailMessage.= chunk_split(base64_encode($html))."\r\n";
		$emailMessage.= "--".$uid."\r\n";
		$emailMessage.= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
		$emailMessage.= "Content-Transfer-Encoding: 7bit\n\n";
		$emailMessage.="if can't recive html mail get this massage "\n\n";
		$emailMessage.= "--".$uid."\r\n";		

		$Mailok =mail($Mail_emailadress,"foto for you", $emailMessage, $emailHeaders);
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.