-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
i used this module to send mail with gmail account and create application on google console api and create refresh token and access token. it works fine but the access token expired after 1 hour and after that i can't send another email till generate new access token and copy/paste it on my file how can i used it to work for constantly not just for 1 hour
this is my code
var xoauth2gen = xoauth2.createXOAuth2Generator({
user: {user},
clientId: {clientId},
clientSecret: {clientSecret},
refreshToken: {refreshToken},
accessToken: {accessToken}
});
xoauth2gen.on('token', function(token){
console.log('New token for %s: %s', token.user, token.accessToken);
});
var mailOptions = {
from: {mail-from},
to: {email-to},
subject: '......',
html: '......'
};
transporter.sendMail(mailOptions, function(error, info){
if(error){
console.log(error);
}else{
console.log('Message sent: ' + info.response);
}
transporter.close();
});
i will appreciate any help
Thanks for your effort
Metadata
Metadata
Assignees
Labels
No labels