Click to See Complete Forum and Search --> : send mail attach img


Anon
12-13-2001, 05:23 AM
hi all
i'm working send mail with attach img.
if img have in my directory, It send.
But if i send mail, i use <input type='file' name='attach_file'>, It not send.
i want when i attach img, it send my outlook. pls help me.
source here:
example.php
<form action="sendmail">
<input type="file" name="file_img" value="<?echo $file_img?>">
</form>
sendmail.php
require "maillib.php";
$toText ="ttyen76@yahoo.com";

$subject="test image";
$m= new Mail;

$m->From($email);
$m->To($toText);
$m->Subject($subject);

if ($fimg=fopen("attach_img.jpg", 'wb'))
{
fwrite($fimg, $file_img);
fclose($fimg);
$m->Attach( "attach_img.jpg", "image" );
}

// Sending Email.....
$m->Send();

echo "thanks your send mail";
exit();

kumar_ldh
12-13-2001, 06:40 AM
Hmmmmmm, Try some thing else go to the famous kartic artcile on mime attachments and html emails. it is though simple to send the attchment i don't get why the hell ur using
follwowing code
<form action="sendmail"> <!--add sendmail.php and try uploading or browsing a file instead the way your adoing is wrong and will not send any mail with attachment as there isn't any.-->
<input type="file" name="file_img" value="<?echo $file_img?>">
</form>

Anon
12-13-2001, 06:46 AM
thanks,
You can write this detail. I try send but it not
I use function:
fopen()
fwrite()
but not send file attachment

kumar wrote:
-------------------------------
Hmmmmmm, Try some thing else go to the famous kartic artcile on mime attachments and html emails. it is though simple to send the attchment i don't get why the hell ur using
follwowing code
<form action="sendmail"> <!--add sendmail.php and try uploading or browsing a file instead the way your adoing is wrong and will not send any mail with attachment as there isn't any.-->
<input type="file" name="file_img" value="<?echo $file_img?>">
</form>