Been using node-imap lately and trying to implement sending emails. Here is the code on feathers/node:
create(data, params) {
return new Promise((resolve, reject) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: this.host,
port: this.smtpPort,
secure: false, // true for 465, false for other ports,
tls: {
rejectUnauthorized: false
},
auth: {
user: this.emailUsername, // generated ethereal user
pass: this.emailPassword // generated ethereal password
}
});
// setup email data with unicode symbols
let mailOptions = {
from: this.emailUsername, // sender address
to: data.to, // list of receivers
subject: data.subject, // Subject line
text: data.body, // plain text body
html: data.body // html body
};
// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
reject(error);
//console.log(error);
}
//console.log('Message sent: %s', info.messageId);
return resolve(info);
});
});
}
this code is running fine and sending email as it should, but after it does its job i cant find those emails in 'Sent' box... anyone experienced with node-imap, what am i missin? Cheers.
EDIT:: Just realised It does save it for some email providers (Gmail, Hotmail) but for some others it doesnt. So I guess i'm not missing anything... but how could I save it manually for other providers who doesnt do it automatically.