Skip to content
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

Updated example #3

Open
rocksolidsr opened this issue Mar 30, 2024 · 0 comments
Open

Updated example #3

rocksolidsr opened this issue Mar 30, 2024 · 0 comments

Comments

@rocksolidsr
Copy link

I had to make the following changes to get it to run

`
//import mail2pdf from 'mail2pdf';
//import { promises as fs } from 'fs';

const fs = require('fs.promises');
const mail2pdf = require('mail2pdf');

(async () => {
// Simply call the mail2pdf() function with the email (or
// emails as an array) you want to convert. You can also
// pass additional options, see below for details.
const pdf = await mail2pdf('email.eml', { language: 'en' });
// The resulting PDF is returned as a Buffer that you can
// save to disk for example.
await fs.writeFile('sample.pdf', pdf);
})();
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant