Sending image with phpmailer

Asked

Viewed 256 times

0

I have a website that the fomulário needs to be authenticated,I’m using the phpmailer library, so far so good I got, however this form has a photo that should be sent together and I’m not able to make this image arrive in the inbox. I used several examples that ni on the internet, like this $mail->addAttachment($_FILES['arquivo']); but it didn’t work :/

  • try to be more specific which error appeared ?

  • This error appeared Fatal error: Call to a Member Function Addattachment() on a non-object in /home/sindesep/public_html/teste1/enviar.php on line 29

1 answer

-1

Try switching to $mail->addAttachment($_FILES['arquivo']['tmp_name']).

I’m not sure how the method addAttachment works, but I guess he wasn’t prepared to read the key tmp_name alone.

  • I’ve already used this code, the email is sent but does not reach the attached photo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.