Forum Moderators: coopster

Message Too Old, No Replies

How to mail and image?

How to mail and image?

         

ryanc

5:50 pm on Aug 25, 2005 (gmt 0)

10+ Year Member


ok, I'm very much a novice with PHP. I'm trying to send an image within a form to an email, I've tried the following:

1.
$from = 'picture.jpg';
$pic = copy($from, null);

$form = "blah blah blah $pic";

mail("mymail@mail.com", "Form", $form);

2.
$open = fopen("picture.jpg", "wb"[smilestopper]);
$pic = copy($open, null);

$form = "blah blah blah $pic";

mail("mymail@mail.com", "Form", $form);

3.
$open = fopen("picture.jpg", "wb"[smilestopper]);
$get = fgets($open);
$pic = copy($get, null);

$form = "blah blah blah $pic";

mail("mymail@mail.com", "Form", $form);

none of these things work, please help!

Thanks,
ryanc

dreamcatcher

7:55 pm on Aug 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ryanc, you seem to be a little confused on how the mail function works. Try reading this:

[uk.php.net...]

and then download the PHP mailer:

[phpmailer.sourceforge.net...]

dc

ryanc

8:33 pm on Aug 25, 2005 (gmt 0)

10+ Year Member


no, I understand how the mail function works. That parts working fine for me, it's including an image in what I'm mailing out is what I'm having trouble with.

ryanc

8:53 pm on Aug 25, 2005 (gmt 0)

10+ Year Member


ah, I see what your saying, you can't use the mail() function to do an inline image.

thanks,
ryan