-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isBase64 function returning incorrect #671
Comments
I'm still experiencing this issue right now. |
Thanks for the confirmation @Tigerman55! For this issue to gain priority in our backlog, we need additional +1's or a PR. When we receive a PR, that provides the biggest jump in priority. |
Same issue here. I just removed // Removing base64_encode() function due to isBase64 bug
// $fileEncoded = base64_encode(file_get_contents($path));
$fileEncoded = file_get_contents($path);
$mail->addAttachment($fileEncoded, $type, $name); This is a temporary solution until the bug resolved. |
Thanks @fernandoval! |
@thinkingserious Seems that the issue was a little harder than expected 😓 anyone has an idea of what we could do to fix this issue? |
Indeed @martijnmelchers, I've put this on our backlog for further investigation. |
We hit this issue too, we had in our composer "sendgrid/sendgrid": "~7.0" and suddenly in a push all our email attachments broke (double base 64 encoding), so we've forced 7.0.0 until we can look into the issue. Would be great to get a fix or release it as a breaking change. |
Thanks for reporting this @eddturtle, we have this on our backlog for a fix and your vote helps it gain priority. |
Maybe we add a parameter to the function to optionally enable this feature. Then, when we receive non-base encoded content, we can throw an error and inform them of how to use the auto-encoding. |
I made a change to
I removed
The original code doesn't work because I don't see a point to have Although removing I'm fairly new to both PHP and Git, so correct me if I'm wrong about anything. Thanks! |
This has been a fairly costly bug for us. |
Hello Everyone! I just finished testing v7.2.1 and it appears to solve this bug. My apologies for all the trouble this caused and thank you for helping me track it down and get a fix in. If you continue to experience any issues with this functionality, please feel free to continue the conversation here. With Best Regards, Elmer BTW, the failing test appears to be unrelated to this issue. |
Issue Summary
via @mikepage
I had to remove the base64_encode function in this line of code in order to keep the attachments readable.
$email->addAttachment(base64_encode(file_get_contents($attachment['tmp_filename'])), 'application/pdf', $attachment['filename'], 'attachment');
The text was updated successfully, but these errors were encountered: