-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
How to attach pdf from url #601
Comments
Anyone? |
I was able to use the same code to successfully send the PDF attachment. The file is quite large though so I'd suggest you to not fetch it from an URL but store it to a file first and then send that file from a disk. Could you store and upload the raw source of the corrupt message so it would be possible to check how the message is corrupt? |
True, when I first saved PDF file on disk and run changed script ( used attaching as file from disk) then I got correct pdf file. Second, my first example file was too large so I try to attach smaller file via URL methode using path:'url' but again I got corrupted pdf file. |
The corrupted file seems to be a HTML error response from a proxy server. Nodemailer does not support fetching URLs through proxies so you have to prefetch the file first if you want to send it. |
Hello, I tried running the same code using a PDF locally. Though the PDF appears in the email, it's corrupted (even though pdf opens on local system).
|
This happens to me too! A valid local PDF when sent as an attachment gets delivered corrupted. |
This is still a problem to me. Exactly like @vdraceil described. |
I have the same problem, any solution? And I find even I send a txt file, there is also problem, the nodemailer can find the txt file on my server, but it just send with an empty txt file. |
Has anyone solved this? It is still an issue. |
Hi I solved this in this way thanks to Ilya Khadykin
in my case i was sending an excel file |
Hi josco007, I have use your code however I didn't put in any proxy. The output also failed due to security issue. The action is blocked by the CORS. May I now have other alternative? |
Include the following information with your issue:
Bellow you can see my scriptcode but you should to change SMTP attributes. PDF example file is internet public document so you can use it.
CODE
The text was updated successfully, but these errors were encountered: