PDF attachment download not working in email in IOS/MAC/APPLE |
Hi
I am sending pdf as attachment in email, it works fine when sending "inline", but I found issue, inline pdf is not working properly in ios/mac/apple. So I tried to send force downloadable attachment, it attaches file and I am able to download file, but it doesn't show file content and shows error "Failed to load PDF document." (https://prnt.sc/x0S_mf47G4c4). File showing corrupted on ios/mac/apple and gmail also. I have checked the file path, it's correct and same file works fine in inline mode. I tried the followings, but doesn't worked PHP Code: 1. $email->attach($attachment, 'attachment', basename($attachment), 'application/pdf'); PHP Code: 2. $email->attach($attachment, 'attachment', 'filename.pdf', 'application/pdf'); PHP Code: 3. $tempPath = WRITEPATH . 'temp/' . uniqid() . '.bin'; below is my code to send email, please help to resolve this issue. PHP Code: function sendEmail($data = []) Thanks
You may need to et the pdf headers.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |