Jump to content

PHPMailer class - Image attachment


scotchegg78

Recommended Posts

Hi Guys

 

I am trying to get the phpmailer class working with an image attachment from a html form.

It works ( sort of) in that it sends an email with other form elements, but no working attachment.

 

my html form is simply..

 

<input type="file" name="file" value=""/>

 

and the aspect for the form is...

 

$encoding = "base64";
$type = "application/octet-stream"; 

$mail->AddStringAttachment($_FILES['file']['tmp_name'],$_FILES['file']['name'],$encoding,$type); 

 

-update

sorry i should of added i am using string method with the aim of not having to save the file to a server first from upload.

 

If anyone else uses this phpmailer class, i would appreciate some advice.

thanks

Link to comment
https://forums.phpfreaks.com/topic/175058-phpmailer-class-image-attachment/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.