Comments on: Send Email with Attachment in PHP https://www.codexworld.com/send-email-with-attachment-php/ Web & Mobile App Development Company Sun, 19 Apr 2026 15:49:08 +0000 hourly 1 By: Ottavino Gnata https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-231399 Fri, 24 Mar 2023 20:00:42 +0000 https://www.codexworld.com/?p=2741#comment-231399 Thank you very much for great help

]]>
By: Alcides https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-227750 Tue, 07 Feb 2023 16:06:32 +0000 https://www.codexworld.com/?p=2741#comment-227750 Great!!! Thanks a lot!!
This code worked perfect!

]]>
By: Ed https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-225493 Tue, 03 Jan 2023 13:28:46 +0000 https://www.codexworld.com/?p=2741#comment-225493 The code works. I get an email but my attached file (pdf or jpg) appears in hex format in email body. I’m on web host Hostinger. I think they run Linux servers. Could this have something to do with it and do I need to adjust my code. See below what I’m getting. Please help.

–==Multipart_Boundary_xe4a1d18bb25f8507066079069d78e651x
Content-Type: application/octet-stream; name=”test.pdf”
Content-Description: test.pdf
Content-Disposition: attachment;
filename=”test.pdf”; size=121846;
Content-Transfer-Encoding: base64

JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAgL1hPYmplY3QgCi9TdWJ0eXBlICAvSW1hZ2UgCi9X
aWR0aCAgNDI4IAovSGVpZ2h0ICAxNDQgCi9GaWx0ZXIgIC9GbGF0ZURlY29kZSAKL0JpdHNQZXJD
b21wb25lbnQgIDggCi9EZWNvZGVQYXJtcyA8PAovUHJlZGljdG9yICAxNSAKL0NvbG9ycyAgMyAK

]]>
By: Ali https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-220847 Sun, 30 Oct 2022 20:40:43 +0000 https://www.codexworld.com/?p=2741#comment-220847 Hello thank for the solution you save me but how can i insert php variable in htmlContent

]]>
By: Val https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-207380 Fri, 23 Sep 2022 10:02:49 +0000 https://www.codexworld.com/?p=2741#comment-207380 You save my day, thanks bro !
All others solutions don’t work, even on php mail documentation.

]]>
By: Mehul https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-159767 Mon, 27 Dec 2021 10:28:47 +0000 https://www.codexworld.com/?p=2741#comment-159767 how to add multiple Bcc address

]]>
By: Usman Mustafa Khawar https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-153247 Mon, 04 Oct 2021 11:09:14 +0000 https://www.codexworld.com/?p=2741#comment-153247 Thanks Brohter, It Worked… None of stackoverlow.com solutions worked for me but your solution worked like a charm. Thanks again.

]]>
By: Emanuele https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-152484 Fri, 24 Sep 2021 11:46:33 +0000 https://www.codexworld.com/?p=2741#comment-152484 Nice code….but mail goes to spam. try to @gmail
Any suggestion?
Thx

]]>
By: hans rondon https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-133493 Fri, 29 Jan 2021 16:56:52 +0000 https://www.codexworld.com/?p=2741#comment-133493 friend, my file is an image, I’m sending it through a form
// Attached file
$ file = “files / codexworld.pdf”; ….. how would I receive my image here

]]>
By: ivan https://www.codexworld.com/send-email-with-attachment-php/comment-page-1/#comment-128347 Wed, 25 Nov 2020 10:21:11 +0000 https://www.codexworld.com/?p=2741#comment-128347 How can I adapt to send multiple files ?, all the ones in a directory.
Thanks!!

]]>