Sending an image to email via PHP
<p>can you please help me with this code. i am trying to embed a image in my mail and its showing as string of alphanumeric ..</p>

<pre><code>function send_mail_pear()
{

    $crlf = "\n";

    $to = "mail@mail.in";
    $head = ("From: mail@mail.in". "\r\n");
    $head .= "Content-type: text/html\r\n";
    $head .= "Content-Type: image/jpeg"; 

    $mime = new Mail_mime($crlf);
    echo $head. "&lt;br/&gt;";
    $mime-&gt;setHTMLBody('&lt;html&gt;&lt;body&gt;&lt;img src="map_6.gif"&gt; &lt;p&gt;You see this image.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;');
    $mime-&gt;addHTMLImage('map_6.gif', 'image/gif');  

    $subject = "Test mail";
    $mailBody = $mime-&gt;get();
    $mail =&amp; Mail::factory('mail');
    echo $mailBody ;

    /*if(mail($to, $subject, $mailBody, $head)){
        echo "successful";
    } else {
        echo "Mail Not sent";
    }
}
</code></pre>
