-
Notifications
You must be signed in to change notification settings - Fork 23
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
Base64 Encoded PDF Fails #11
Comments
reported this bug 5 years ago and still not fixed :( |
I found a work around about this bug. I use this lib on Symfony app. Doesn't work foreach ($email->getAttachments() as $file) {
$sendSmtpEmailAttachment = (new SendSmtpEmailAttachment())
->setName($file->getFilename())
->setContent(base64_encode($file->getContent()));
$attachments[] = $sendSmtpEmailAttachment;
}
$sendSmtpEmail->setAttachment($attachments); Works like a charm $attachments = [];
foreach ($email->getAttachments() as $file) {
$attachments[] = [
'name' => $file->getFilename(),
'content' => base64_encode($file->getContent()),
];
}
$sendSmtpEmail->setAttachment($attachments); Warning You need to check what you receive before. Because you avoid that regex with that solution. |
@StevenRenaux Thank you so much ! this fixed it for me ! |
When using the SendSmtpEmailAttachment.php to send a PDF, sometimes the preg_match on line 266 fails without reason. Please remove this preg check or fix it. I am using a base_64 encoded PDF and it works fine to send it if I comment out the preg_match.
The text was updated successfully, but these errors were encountered: