I am trying to deploy this example to Cloud Foundry
https://github.com/andris9/Nodemailer/blob/master/examples/example_smtp.js
Here is what I did:
npm install nodemailerexample_smtp.js to app.js and edit fields for right email credentialnode app.js locally and it works / email sentvmc push and got below errorUploading mytestmailer... FAILED Upload failed. Try again with 'vmc push'. Errno::ENOENT: No such file or directory - C:/Users/username/AppData/Local/Temp/. vmc_hocmailer_files/node_modules/nodemailer/node_modules/simplesmtp/node_modules /xoauth2/node_modules/request/node_modules/form-data/node_modules/combined-strea m/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js For more information, see ~/.vmc/crash
I search and found this thread to figure out what is in ~/.vmc/crash
how to access ~/.vmc/crash folder on Cloud foundry
But I am using Windows so I cannot find that crash file.
Can someone help me to troubleshoot this issue? Seem to be a simple deployment.
You need to make sure you create a package.json file that specifies the dependencies of the application, in this case it should look something like this;
{
"name": "node-mailer-example",
"version": "0.0.1",
"dependencies": {
"nodemailer": "*"
}
}
With nothing but this and app.js in the folder, install the dependencies for the application with npm;
npm install
This should create a new 'node_modules' folder with the dependencies included inside.
Also, you need to change the first line of your app.js file so it reads;
var nodemailer = require('nodemailer');
I did it like this and it deployed ok, I got this message in the application log;
SMTP Configured
Sending Mail
Error occured
Invalid login - 535-5.7.1 Please log in with your web browser and then try again. Learn more at
535 5.7.1 https://support.google.com/mail/bin/answer.py?answer=78754 hr1sm24898342qeb.3 - gsmtp
BTW, when you send mail on mass through gMail, where each e-mail has the same content, gMail will eventually require you log in via the web interface before you can continue.