Maybe your email got caught in Google's Spam filters. Or one of your email 
rules deleted it. Maybe obvious, but did you check the spam/trash and such 
folders?

Also, maybe your actual sender and/or domain combo is weird. E.g. you can 
set up a domain DNS so that it's only allowed to send emails from a certain 
IP address or range, or such combinations.

Did you check here?

https://support.google.com/mail/troubleshooter/2920052?visit_id=636797743968862672-3109617686&hl=en&rd=2

Zlatko

On Thursday, December 6, 2018 at 5:21:56 PM UTC+1, Ryan Liu wrote:
>
> I was trying to send a mail through my own smtp server made using 
> smtp-server <https://nodemailer.com/extras/smtp-server/> and I checked my 
> Gmail account and it is not sending.
> Here is my smtp server.
>
> const SMTPServer = require("smtp-server").SMTPServer
> var fs = require("fs")
> const server = new SMTPServer({
>     secure: true,
>     key: fs.readFileSync("C:/Users/Jerome/smtp.key"),
>     cert: fs.readFileSync("C:/Users/Jerome/smtp.cer"),
>     size:1024,
>     onAuth(auth, session, callback){
>         if(auth.username !== 'abc' || auth.password !== 'def'){
>             return callback(new Error("Invalid Credentials"));
>         }
>         callback(null, {user: 123}); // where 123 is the user id or 
> similar property
>     },
>     onMailFrom(address, session, callback){
>         if(address.address !== "nor...@example.com <javascript:>"){
>             return callback(new Error("Only nor...@example.com 
> <javascript:> is allowed to send emails"))
>         }
>         return callback()
>     },
>     onData(stream, session, callback){
>         stream.pipe(process.stdout)
>         stream.on('end', () => {
>             if (stream.sizeExceeded){
>                 return callback(new Error('size excedded'))
>             }
>             return callback(null, "sent")
>         })
>     }
> });
> server.listen(465)
> server.on('error', function(err){
>     console.log(err)
> })
>
>
> Here is the mailing program
>
> const nodemailer = require("nodemailer")
> const transport = nodemailer.createTransport({
>     host:"localhost",
>     port:465,
>     secure:true,
>     auth: {
>         type:"login",
>         user:"abc",
>         pass:"def"
>     },
>     tls: {
>         rejectUnauthorized: false
>     }
> })
> transport.sendMail({
>     from:"nor...@example.com <javascript:>",
>     to:"xx...@gmail.com <javascript:>",
>     subject:"test",
>     text:"test"
> }, function(err,info){
>     if (err) {
>         console.log(err)
>     } else {
>         console.log(info.response)
>     }
> })
>
> I ram the smtp server first then the mailing program and the smtp server 
> responds with a 250 sent
> What is wrong with the code or what happened?
> How should I change the code?
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/5f6340db-4be6-4e11-83ae-4cc9b38ac723%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to