Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit abc896b

Browse files
author
gevic
committed
Nodemailer
1 parent a26e2bb commit abc896b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎nodeMailer.js‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Nodemailes is a module to send mails
2+
// Download using ```npm install nodemailer
3+
var mail = require('nodemailer');
4+
5+
// To send a simple mail
6+
// To send a mail you need some kind of transport
7+
var transport = mail.createTransport({
8+
service: 'gmail', // you mail service provider
9+
auth:{
10+
user: 'email@gmail.com',
11+
pass: 'secret'
12+
}
13+
});
14+
15+
// Now mail structure
16+
var mailStructure = {
17+
from: 'email@gmail.com',
18+
to: 'reciever@anything.com',
19+
subject: 'Checking Nodemailer',
20+
text: 'You got the meassage?'
21+
};
22+
23+
// Everything is ready, just send the mail
24+
transport.sendMail(function (err, info){
25+
if (err){
26+
console.log('error');
27+
} else {
28+
console.log('Email send: ' + info.response);
29+
}
30+
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /