How to send Email using Node.js (Easiest way 🤓 using Sendgrid)

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

ความคิดเห็น • 71

  • @the_full_stack_junkie
    @the_full_stack_junkie  4 ปีที่แล้ว +8

    GitHub Link for this video 😎:
    github.com/LloydJanseVanRensburg/Email-Contact-Form

  • @GarmrZero13
    @GarmrZero13 2 ปีที่แล้ว +2

    This vid is a hidden gem. Thanks, I learned a lot

  • @test-xi1ot
    @test-xi1ot 3 ปีที่แล้ว +2

    Wow! I got the point in 4 mins, you saved my many hours of struggle. Thanks, Mate, Now I am gonna learn from all your videos as all are real-time, thanks again sir

  • @khandoor7228
    @khandoor7228 4 ปีที่แล้ว +2

    Excellent stuff FSJ! thanks and pls keep going!

  • @anichuranis2843
    @anichuranis2843 2 ปีที่แล้ว +2

    curious mind want to know, why you have stopped publishing awesome tutorial? please let me know.... your are the best tutor i have ever seen

    • @the_full_stack_junkie
      @the_full_stack_junkie  2 ปีที่แล้ว +1

      Hey man thanks for the comment. So I have just been crazy busy. Planning on making video this weekend on git and github basics.
      I have started job and got put ons many different stressful projects and just havent gotten around to doing videos. Really want so change this and get back to making tutorials.

  • @ashish_prajapati_tr
    @ashish_prajapati_tr 2 ปีที่แล้ว +2

    just what i needed.
    👍👍👍

  • @maximo5263
    @maximo5263 2 ปีที่แล้ว +1

    Thank you for the tutorial , It was a master class!

  • @mariemmatri8743
    @mariemmatri8743 3 ปีที่แล้ว +1

    "I'm going to delete this once again, just to make sure you believe me" hahahahahahahaha
    Thank you for the amazing video! I also appreciate a lot mentioning the cases of why would we use a third party email service...

  • @lawrencemandong7711
    @lawrencemandong7711 2 ปีที่แล้ว +1

    You are amazing! Thank you!

  • @SohailKhan-gu2du
    @SohailKhan-gu2du 3 ปีที่แล้ว

    You are a life saver man ♥️🔥.. Keep the content coming 😍

  • @tanchinhei7033
    @tanchinhei7033 2 ปีที่แล้ว

    Thanks a lot! That's exactly what I'm looking for.

  • @JDTK94
    @JDTK94 3 ปีที่แล้ว +1

    excellent ! ty !

  • @sinanozturk3702
    @sinanozturk3702 2 ปีที่แล้ว

    THANKS!

  • @amitmehta8554
    @amitmehta8554 3 ปีที่แล้ว +1

    Thanks!! for this :)

  • @francescopiccirillo8763
    @francescopiccirillo8763 2 ปีที่แล้ว +1

    Hi, I would like to use the contact form into my index.html file. Is it possible to make contact.ejs as a "partial" and insert into the html file? Your help will be really appreciate! Thank you

  • @sagarburada
    @sagarburada 3 ปีที่แล้ว +1

    Thanks.. Mate..

  • @thejamaicandudewith100ksub3
    @thejamaicandudewith100ksub3 2 ปีที่แล้ว

    Why didn't you check for an error before redirecting? Like when you call the sendEmail function and pass in the 4 arguments the function itself has error handling but it appears that the user would be redirected regardless of the outcome.
    In the utils function I would do 👇🏼
    return {status: 201, message: 'Congrats, email was sent successfully.'} for success and
    return {status: 404, message: 'Sorry, there was an error in sending..'} in the case of an error
    So if the status code is a success one (201) then I would redirect to sent, otherwise I would display something else. I like how you explain everything though you are a very good teacher

  • @pankajmishra3559
    @pankajmishra3559 3 ปีที่แล้ว +1

    I signed up for an account in sendgrid. But I am unable to login.
    Every time I tried to log in, I am getting the error message "You are not authorized to access SendGrid, please contact".
    on signup, I didn't get any email from SendGrid to activate the account.
    Anyone having the same issue.
    I mailed to their support team, I am waiting for their response.

  • @jy6687
    @jy6687 3 ปีที่แล้ว

    Thank a million. I can't say thank you enough. But pls I want to integrate what I learnt from your video into a real-life project. for example, the contact form you used was saved as contact.ejs and my is index.html. how do I go about this change in the file name and all my html and contact form is in one file index.html. Your prompt response will be deeply appreciated. thanks in anticipation for your prompt response.

  • @143ryan8
    @143ryan8 3 ปีที่แล้ว +1

    will this work with nodejs with handlesbars??

    • @ewitte
      @ewitte 3 ปีที่แล้ว

      ejs is like handlebars .....

  • @victordavidgonzalezlemus3079
    @victordavidgonzalezlemus3079 2 ปีที่แล้ว

    Thanks a lot..! Can I use EJS to send template HTML..?

  • @ericquiroz2729
    @ericquiroz2729 5 หลายเดือนก่อน

    how do you do to start the nodeMailer in prod?

  • @vugarbeats
    @vugarbeats 6 หลายเดือนก่อน

    there is a text "via sendgrid" on the email. how can i remove it?

  • @mdkawsar718
    @mdkawsar718 3 ปีที่แล้ว

    thanks sir

  • @siddhidgopujkar7994
    @siddhidgopujkar7994 2 ปีที่แล้ว

    Can we host this on cloudflare pages?

  • @dianaeleiratrianasuarez9137
    @dianaeleiratrianasuarez9137 3 ปีที่แล้ว

    Gracias!!!

  • @indiaaworldleader6657
    @indiaaworldleader6657 ปีที่แล้ว

    I having problem to create sendgrid account. Can you halp me out with this?

  • @auxiliumcorporateconsultan803
    @auxiliumcorporateconsultan803 3 ปีที่แล้ว +1

    How did you create package.json and server.js This my first time, any help would be apricated.

    • @the_full_stack_junkie
      @the_full_stack_junkie  3 ปีที่แล้ว +1

      Hi, for the package.json you just navigate into your project folder with you terminal and run the command "npm init" this will prompt you with a few question. And for the server.js you can just create a file and name it server.js or you can use terminal again inside project folder and run the command "touch server.js". Hope this helps

  • @modernity3323
    @modernity3323 4 ปีที่แล้ว +1

    Thanks.. could you please leave the GitHub link

    • @the_full_stack_junkie
      @the_full_stack_junkie  4 ปีที่แล้ว

      Just pinned the links in the comments. Sorry for only doing it now

  • @thenav8430
    @thenav8430 3 ปีที่แล้ว

    what if I haven't company? What will I write in Create Sender? Thanks

  • @victorscherman1437
    @victorscherman1437 3 ปีที่แล้ว +1

    Love the Jeff Bezos user credentials

  • @Haylem
    @Haylem 2 ปีที่แล้ว

    How come im not getting any emails??? i cloned it from yours and still not working... it gives me in terminal that email was sent though, req.body looks good too.

    • @the_full_stack_junkie
      @the_full_stack_junkie  2 ปีที่แล้ว

      Did you use your own api keys?

    • @Haylem
      @Haylem 2 ปีที่แล้ว

      @@the_full_stack_junkie I got it to work, really strange bugs with my server.js, kept giving me random syntax errors even if i used your exact code but forking your repo works just fine. Thanks

  • @arinaghumashyan4988
    @arinaghumashyan4988 3 ปีที่แล้ว +1

    Will this work with react native?

    • @the_full_stack_junkie
      @the_full_stack_junkie  3 ปีที่แล้ว +1

      The backend route for handling the email should work. The frontend will probably differ though

  • @joeljoy7294
    @joeljoy7294 2 ปีที่แล้ว

    why email not sent message will came

    • @tanchinhei7033
      @tanchinhei7033 2 ปีที่แล้ว

      I've got the same problem as yours but I've fixed it. Please double check your 'to' & 'from' fields need to follow exactly with the Single Sender Verification that you have entered.
      Another is please make sure your API key is correct. *without space
      You can create another key and try again😊

  • @shalombloodman790
    @shalombloodman790 2 ปีที่แล้ว

    I had coded a backend for a contact form not too long ago. The emails were sending but the content wasn’t there. I kept getting undefined. I tried your video and the emails also send, but I still get the same response. I’m wondering if it’s something wrong with the express middleware or something, but I’m not sure. I was wondering if you could help me

    • @the_full_stack_junkie
      @the_full_stack_junkie  2 ปีที่แล้ว

      So are you using Sendgrid or some other email service provider?
      Are you using Nodemailer or there own sdks for sending the emails in code?
      Are your emailing setup replying with any error logs?
      And are you saying the email content is undefined? So it does deliver to the user?

    • @shalombloodman790
      @shalombloodman790 2 ปีที่แล้ว

      @@the_full_stack_junkie using sendgrid. I do use an error handler. Yes the email is delivered but the content that should show up in the email from req.body isn’t showing…it just says undefined

    • @shalombloodman790
      @shalombloodman790 2 ปีที่แล้ว

      @@the_full_stack_junkie if you still have this code could you attempt testing it again please just for me to verify whether it’s me or not?

    • @the_full_stack_junkie
      @the_full_stack_junkie  2 ปีที่แล้ว

      Are you enabling body parsing for info from the client by using the express bodyparse middleware.
      You can use this by having app.use(express.json()) middleware running in the main server file.

    • @the_full_stack_junkie
      @the_full_stack_junkie  2 ปีที่แล้ว

      I am using the setup in my projects, that code repo i still use as my base emailing setup

  • @christianfarfan3984
    @christianfarfan3984 3 ปีที่แล้ว +1

    Question, so is it gonna be possible to send it to JUST ONE EMAIL, this one (lloydjvrensburg@gmail.com), isnt? Is it possible to send it to the one the user is entering on the input field?

    • @the_full_stack_junkie
      @the_full_stack_junkie  3 ปีที่แล้ว +1

      So just want to make sure i understand your question. You are asking if it is possible so send the some email to the entered email address?
      If this is you answer than yes you should just set the "to" field in the msg object equal to the entered email and a email will be sent to the entered email.
      If this is not your question please try and re phrase?

    • @christianfarfan3984
      @christianfarfan3984 3 ปีที่แล้ว +1

      @@the_full_stack_junkie const to = "${email}"; ... isn't?

    • @the_full_stack_junkie
      @the_full_stack_junkie  3 ปีที่แล้ว

      Yes that would work fine💪

    • @christianfarfan3984
      @christianfarfan3984 3 ปีที่แล้ว +1

      Appreciate the time, already subscribed!!

    • @the_full_stack_junkie
      @the_full_stack_junkie  3 ปีที่แล้ว +1

      @@christianfarfan3984 No problem mate, we are all in this together!😎