P
P
partyzanx2020-02-11 03:20:54
Node.js
partyzanx, 2020-02-11 03:20:54

Why are emails not coming from localhost?

I create sending letters during registration, the site is still on localhost

In index.js

const sgMail = require('@sendgrid/mail'); // sendgrid
sgMail.setApiKey(keys.SENDGRID_API_KEY); // sendgrid


in the right place Report writesawait sgMail.send(regEmail(email)); // sendgrid

{
  accepted: [ '***@gmail.com' ],
  rejected: [],
  envelopeTime: 121,
  messageTime: 163,
  messageSize: 446,
  response: '250 Ok: queued as ***JSKcEA',
  envelope: { from: '***@gmail.com', to: [ '***@gmail.com' ] },
  messageId: '<***[email protected]>'
}


Everything seems to be ok, but neither gmail nor Yandex is accepted, and there is no spam.

Tried different methods, through mailtrap too. It reports success, but in fact there are no letters)

If you directly send letters from smt gmail, then everything works.
Tell me another service, please) Which is free) for password recovery and system registration notifications, for example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rodionov12, 2020-02-12
@partyzanx

You are using a mailing address that does not belong to you. For letters to reach you, you need to:
1. Create a domain and warm it up. Send manually several emails with different but adequate content
2. Authorize the domain in sendgrid and configure the spf signature there
3. Repeat the procedure
Btw, four years ago I sent emails with gmail, everything worked fine, but spam filters are not in place, and the domain check is done via reverse dns, and sendgrid doesn't own gmail.com and can't confirm it, so the mail ends up in spam or doesn't fit the filters at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question