De l'docs:
Nodemailer: Où trouver la documentation
Le connecteur e-mail est essentiellement une interface intégrée LoopBack à la bibliothèque nodemailer. Cette page donne un exemple d'utilisation; Pour une documentation complète des options de configuration , reportez-vous au nodemailer documention.
Here's where nodemailer have documented attachments.
Voici un exemple de différents types de pièces jointes dans le contexte de rebouclage:
app.models.Email.send({
to: '[email protected]',
from: '[email protected]',
subject: 'Email Subject',
html: '<b>Hello</b>',
attachments: [
{ // utf-8 string as an attachment
filename: 'text1.txt',
content: 'hello world!'
},
{ // binary buffer as an attachment
filename: 'text2.txt',
content: new Buffer('hello world!','utf-8')
},
{ // file on disk as an attachment
filename: 'text3.txt',
path: '/path/to/file.txt' // stream this file
},
{ // filename and content type is derived from path
path: '/path/to/file.txt'
},
{ // stream as an attachment
filename: 'text4.txt',
content: fs.createReadStream('file.txt')
},
{ // define custom content type for the attachment
filename: 'text.bin',
content: 'hello world!',
contentType: 'text/plain'
},
{ // use URL as an attachment
filename: 'license.txt',
path: 'https://raw.github.com/nodemailer/nodemailer/master/LICENSE'
},
{ // encoded string as an attachment
filename: 'text1.txt',
content: 'aGVsbG8gd29ybGQh',
encoding: 'base64'
},
{ // data uri as an attachment
path: 'data:text/plain;base64,aGVsbG8gd29ybGQ='
},
{
// use pregenerated MIME node
raw: 'Content-Type: text/plain\r\n' +
'Content-Disposition: attachment;\r\n' +
'\r\n' +
'Hello world!'
}
],
}, err => {
if (err) {
throw err;
}
});
Je crois que cette question devrait être laissée ouverte, car il est pas un doublon dans ce contexte, il est clair ce que l'auteur demande, c'est sur le sujet et pas trop large ou basé sur l'opinion. –
les gens marquent automatiquement les questions maintenant. c'est ridicule – dagda1