damith anuradha
damith anuradha

Reputation: 93

Use sendgrid from send emails with nodemailer appication gives following error?

use nodemailer and nodemailer-sendgrid-transport it show the following error

error:The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements

`const nodemailer=require('nodemailer');
 const sendGridTranspoter=require('nodemailer-sendgrid-transport')

 const transport=nodemailer.createTransport(sendGridTranspoter({

 service: 'SendGrid',

 auth:{
      api_user:'myuser name',
      api_key:'password'
   }));

`

this is inside my sign up controller function

     var email = {
                from: 'sener  email',
                to: 'receiver valid email',
                subject: 'shopMe',
                text: 'successfully sign up',
                html: '<b>Hello world</b>'
              };

            transport.sendMail (email, function(err, info){
                if (err ){
                  console.log(err);
                }
                else {
                  console.log('Message sent: ' + info.response);
                }
            });

Upvotes: 2

Views: 5568

Answers (2)

Andrew
Andrew

Reputation: 330

You need to verify the mail that is the sender. I solved this problem in this way:

Go here: Setting -> Sender Authentication -> Single Sender Verification -> Verify an Address

Example

After that, fill out the form on the right and complete the verification of the sender's mail.

You can read in more detail here.

Upvotes: 3

Ranjith Kumar
Ranjith Kumar

Reputation: 62

there are two possible ways, 1.allow less secure apps "on" in your google mail security 2.Go to sendgrid, click on marketing and after click senders , fillup the details and check it

Upvotes: 3

Related Questions