<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Nodemailer not sending email after the upgrade to new version]]></title><description><![CDATA[<p>Following script was sending email successfully before the upgrade. However, after the upgrade, it's not sending any email and I am not even seeing any error message.  Can you please help me figuring out the problem</p>
<pre><code> var nodemailer = require(&quot;nodemailer&quot;)
 function afterRender(done) {
var transporter = nodemailer.createTransport(&quot;SMTP&quot;,{		
	host:&quot;servername&quot;,
	port:portnumber
});


var reportType=request.options['report-type']
if(reportType==='email'){
    var recipient=request.options['recipient']
    var subject=request.options['subject']
    var fileType=request.options['attachment']
    var message=request.options['message']

    var attachReport=''
        if(fileType==='pdf'){
            attachReport=[{
              filename: 'Report.pdf',
              contents: new Buffer(response.content)
              }]
        }else if(fileType==='excel'){
             attachReport=[{
              filename: 'Report.xlsx',
              contents: new Buffer(response.content)
              }]
        }
        
        var mailOptions={
			from: &quot;DoNotReply@RandomEmail.com&quot;, 
		   	to: recipient, 
		   	subject: subject, 
		   	text: message, 	   
		   	attachments:attachReport							
		}
        
        //Send Email
        
        transporter.sendMail(mailOptions, function(error, response){ 
    	   if(error){
    	       console.log('ERROR:'+error);	
    	       done()
    	   }else{
    	       console.log(&quot;Message sent: &quot; + response.message);							       				       
    	       done();          
    	   }  	
    	});
        
}

//console.log(request.options)

done()

} 
</code></pre>
<p>Here is the config</p>
<pre><code>{
&quot;certificate&quot;: {
    &quot;key&quot;: &quot;certificates/jsreport.net.key&quot;,    
    &quot;cert&quot;: &quot;certificates/jsreport.net.cert&quot;

},
&quot;scripts&quot;: {
    &quot;allowedModules&quot;: [&quot;nodemailer&quot;],
    &quot;timeout&quot;: 60000
},
&quot;license-key&quot;:&quot;we_are_using_license_key&quot;,
&quot;authentication&quot; : {
    &quot;cookieSession&quot;: {
        &quot;secret&quot;: &quot;&lt;your strong secret&gt;&quot;
    },
    &quot;admin&quot;: {
        &quot;username&quot; : &quot;&quot;,
        &quot;password&quot;: &quot;&quot;
    },
    &quot;enabled&quot;: false
},
&quot;connectionString&quot;: { &quot;name&quot;: &quot;fs&quot; },
&quot;httpPort&quot;: portnumber,
&quot;httpsPort&quot;: null,
&quot;blobStorage&quot;: &quot;fileSystem&quot;,
&quot;phantom&quot;: {
    &quot;strategy&quot;: &quot;dedicated-process&quot;,
    &quot;timeout&quot;: 60000
},
&quot;tasks&quot;: {
    &quot;strategy&quot;: &quot;dedicated-process&quot;,
    &quot;timeout&quot;: 10000,
    &quot;allowedModules&quot;: []
}



}</code></pre>
]]></description><link>https://forum.jsreport.net/topic/121/nodemailer-not-sending-email-after-the-upgrade-to-new-version</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 21:43:48 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/121.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jun 2017 20:22:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nodemailer not sending email after the upgrade to new version on Mon, 05 Jun 2017 20:25:06 GMT]]></title><description><![CDATA[<p>Following script was sending email successfully before the upgrade. However, after the upgrade, it's not sending any email and I am not even seeing any error message.  Can you please help me figuring out the problem</p>
<pre><code> var nodemailer = require(&quot;nodemailer&quot;)
 function afterRender(done) {
var transporter = nodemailer.createTransport(&quot;SMTP&quot;,{		
	host:&quot;servername&quot;,
	port:portnumber
});


var reportType=request.options['report-type']
if(reportType==='email'){
    var recipient=request.options['recipient']
    var subject=request.options['subject']
    var fileType=request.options['attachment']
    var message=request.options['message']

    var attachReport=''
        if(fileType==='pdf'){
            attachReport=[{
              filename: 'Report.pdf',
              contents: new Buffer(response.content)
              }]
        }else if(fileType==='excel'){
             attachReport=[{
              filename: 'Report.xlsx',
              contents: new Buffer(response.content)
              }]
        }
        
        var mailOptions={
			from: &quot;DoNotReply@RandomEmail.com&quot;, 
		   	to: recipient, 
		   	subject: subject, 
		   	text: message, 	   
		   	attachments:attachReport							
		}
        
        //Send Email
        
        transporter.sendMail(mailOptions, function(error, response){ 
    	   if(error){
    	       console.log('ERROR:'+error);	
    	       done()
    	   }else{
    	       console.log(&quot;Message sent: &quot; + response.message);							       				       
    	       done();          
    	   }  	
    	});
        
}

//console.log(request.options)

done()

} 
</code></pre>
<p>Here is the config</p>
<pre><code>{
&quot;certificate&quot;: {
    &quot;key&quot;: &quot;certificates/jsreport.net.key&quot;,    
    &quot;cert&quot;: &quot;certificates/jsreport.net.cert&quot;

},
&quot;scripts&quot;: {
    &quot;allowedModules&quot;: [&quot;nodemailer&quot;],
    &quot;timeout&quot;: 60000
},
&quot;license-key&quot;:&quot;we_are_using_license_key&quot;,
&quot;authentication&quot; : {
    &quot;cookieSession&quot;: {
        &quot;secret&quot;: &quot;&lt;your strong secret&gt;&quot;
    },
    &quot;admin&quot;: {
        &quot;username&quot; : &quot;&quot;,
        &quot;password&quot;: &quot;&quot;
    },
    &quot;enabled&quot;: false
},
&quot;connectionString&quot;: { &quot;name&quot;: &quot;fs&quot; },
&quot;httpPort&quot;: portnumber,
&quot;httpsPort&quot;: null,
&quot;blobStorage&quot;: &quot;fileSystem&quot;,
&quot;phantom&quot;: {
    &quot;strategy&quot;: &quot;dedicated-process&quot;,
    &quot;timeout&quot;: 60000
},
&quot;tasks&quot;: {
    &quot;strategy&quot;: &quot;dedicated-process&quot;,
    &quot;timeout&quot;: 10000,
    &quot;allowedModules&quot;: []
}



}</code></pre>
]]></description><link>https://forum.jsreport.net/post/540</link><guid isPermaLink="true">https://forum.jsreport.net/post/540</guid><dc:creator><![CDATA[Farah Javed]]></dc:creator><pubDate>Mon, 05 Jun 2017 20:25:06 GMT</pubDate></item><item><title><![CDATA[Reply to Nodemailer not sending email after the upgrade to new version on Invalid Date]]></title><description><![CDATA[<p>Why do you have <code>done()</code> at the end of the script? Shouldn't it be in the else branch?</p>
]]></description><link>https://forum.jsreport.net/post/544</link><guid isPermaLink="true">https://forum.jsreport.net/post/544</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Nodemailer not sending email after the upgrade to new version on Invalid Date]]></title><description><![CDATA[<p>thanks, it solved my problem.</p>
]]></description><link>https://forum.jsreport.net/post/554</link><guid isPermaLink="true">https://forum.jsreport.net/post/554</guid><dc:creator><![CDATA[Farah Javed]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>