Sendgrid-nodejs: TypeError: SGmail.setApikey is not a function

Created on 26 May 2019  Â·  4Comments  Â·  Source: sendgrid/sendgrid-nodejs

Ive been trying to add a registration successfull email feature to my node js user login project.Please help.
i used the following code:
var SGmail = require('@sendgrid/mail')
SGmail.setApikey("SG.XXXX");
const msg = {
to: '@gmail.com',
from: '@gmail.com',
subject: 'Sending with Twilio SendGrid is Fun',
text: 'and easy to do anywhere, even with Node.js',
html: 'and easy to do anywhere, even with Node.js',
};
sgMail.send(msg);

unknown or a waiting for feedback question

Most helpful comment

Thanks a lot for replying Elmer
I actually made a pretty stupid mistake .the K in setApiKey should be in
uppercase ,i mistyped that.

On Tue, May 28, 2019 at 11:27 PM Elmer Thomas notifications@github.com
wrote:

Hello @emilfrancis2027 https://github.com/emilfrancis2027,

Can you please verify what version of this SDK you are using?

If you hare on the latest version, then this example
https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/single-email-single-recipient.md#send-a-single-email-to-a-single-recipient
should work for you.

Thanks!

With Best Regards,

Elmer

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sendgrid/sendgrid-nodejs/issues/936?email_source=notifications&email_token=AMFOC374RSHGYVA5227J2GLPXVXARA5CNFSM4HPWFWP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWM54GA#issuecomment-496623128,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMFOC3YFXK4BNOUVM4TDSATPXVXARANCNFSM4HPWFWPQ
.

All 4 comments

Hello @emilfrancis2027,

Can you please verify what version of this SDK you are using?

If you hare on the latest version, then this example should work for you.

Thanks!

With Best Regards,

Elmer

I actually made a pretty stupid mistake .the K in setApiKey should be in uppercase ,i mistyped that.

Thanks a lot for replying Elmer
I actually made a pretty stupid mistake .the K in setApiKey should be in
uppercase ,i mistyped that.

On Tue, May 28, 2019 at 11:27 PM Elmer Thomas notifications@github.com
wrote:

Hello @emilfrancis2027 https://github.com/emilfrancis2027,

Can you please verify what version of this SDK you are using?

If you hare on the latest version, then this example
https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/single-email-single-recipient.md#send-a-single-email-to-a-single-recipient
should work for you.

Thanks!

With Best Regards,

Elmer

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sendgrid/sendgrid-nodejs/issues/936?email_source=notifications&email_token=AMFOC374RSHGYVA5227J2GLPXVXARA5CNFSM4HPWFWP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWM54GA#issuecomment-496623128,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMFOC3YFXK4BNOUVM4TDSATPXVXARANCNFSM4HPWFWPQ
.

Thanks for following up!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amlcodes picture amlcodes  Â·  4Comments

umarhussain15 picture umarhussain15  Â·  3Comments

Loriot-n picture Loriot-n  Â·  4Comments

thinkingserious picture thinkingserious  Â·  4Comments

agostonbonomi picture agostonbonomi  Â·  3Comments