Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/barang/update/:id', isLoggedIn, upload.single('foto'), BarangController.update, function(req, res, next){
- mailer.extend(app, {
- from: 'no-reply@example.com',
- host: 'smtp.gmail.com', // hostname
- secureConnection: true, // use SSL
- port: 465, // port for secure SMTP
- transportMethod: 'SMTP', // default is SMTP. Accepts anything that nodemailer accepts
- auth: {
- user: 'gmail.user@gmail.com',
- pass: 'userpass'
- }
- });
- app.mailer.send('email', {
- to: 'example@example.com', // REQUIRED. This can be a comma delimited string just like a normal email to field.
- subject: 'Test Email', // REQUIRED.
- otherProperty: 'Other Property' // All additional properties are also passed to the template as local variables.
- }, function (err) {
- if (err) {
- // handle error
- console.log(err);
- res.send('There was an error sending the email');
- return;
- }
- res.send('Email Sent');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement