Send Emails in Node.js | NodeMailer Tutorial

Поделиться
HTML-код
  • Опубликовано: 10 янв 2023
  • 👉 Source code: openjavascript.info/2023/01/1...
    ‍🎓 NEW: Earn a professional certificate in web development from Meta Inc. (course links in card below) 👇
    ⚡ Need hosting for a website, WordPress blog or Node.js app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
    This tutorial shows you how to send emails in Node.js using the NodeMailer package. Includes how to send an email to multiple addresses and add attachments.
    #email #emails #nodejs #nodejstutorial #nodemailer #smtp #javascript
    Gmail SMTP server details: support.google.com/mail/answe...
    ⚡Web development professional certificates from Meta Inc.⚡
    Front-End Developer Professional Certificate: imp.i384100.net/b3dMek
    Back-End Developer Professional Certificate: imp.i384100.net/gbYorg
    iOS Developer Professional Certificate: imp.i384100.net/Jr7qj2
    Meta Android Developer Professional Certificate: imp.i384100.net/oeYnGo
    Meta Database Engineer Professional Certificate: imp.i384100.net/BX7KGB

Комментарии • 50

  • @OpenJavaScript
    @OpenJavaScript  Год назад +1

    Thanks for watching!
    👉 Source code: openjavascript.info/2023/01/10/nodemailer-tutorial-send-emails-in-node-js/

  • @kevinsuvarna1795
    @kevinsuvarna1795 Год назад +8

    Thank you so much for this video. It really helped me out a lot!

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      That's great to hear! Always happy to hear somone has found a tutorial useful :)

  • @superboring7990
    @superboring7990 11 месяцев назад

    ❤❤
    Thank you sir!!

  • @YoSoyRaulTV
    @YoSoyRaulTV Год назад +1

    NICE! thanks

  • @user-mk7rp4ev4p
    @user-mk7rp4ev4p 4 месяца назад

    Thank you very much Sir

  • @ASAPGolri
    @ASAPGolri Год назад +4

    Hello, thank you for this video.
    I've had no problem to make it work on my computer but when I'm putting it on production the server returns an error 535 'authentification error' command: 'AUTH PLAIN', I've tried a lot of things but it's still the same issue.
    Have you got some clue of what is happening?

  • @sebastianmeckovski9980
    @sebastianmeckovski9980 3 месяца назад +1

    so easy when doing it locally. Once you try to deploy it that's when you get into issues

  • @ivanananiev6618
    @ivanananiev6618 6 месяцев назад

    Nice video

  • @kuldeeppanwar9513
    @kuldeeppanwar9513 8 месяцев назад

    Thanks bro

  • @hasanv
    @hasanv Год назад +1

    Thanks, would be helpful

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      Yes, can definitely be extremely useful to know how to do this :)

  • @cloudsystem3740
    @cloudsystem3740 Год назад +1

    thank you very much please make a tutorial with imap :)

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      You are welcome and thanks for the tutorial suggestion! Putting it on the ideas list :)

  • @tatsumii1420
    @tatsumii1420 8 месяцев назад

    can i do this in react also?

  • @LowkeyCoder
    @LowkeyCoder 9 месяцев назад

    is there any way to send large no emails to my customers?

  • @innocent3163
    @innocent3163 2 месяца назад

    Sir, it’s work fine in dev, but not sending emails in production, what to do ?

  • @priyanshjain9746
    @priyanshjain9746 9 месяцев назад

    when deploy this program in c panel email not sent

  • @MuhammadFaizanVlogger
    @MuhammadFaizanVlogger 3 месяца назад

    emailjs plan offer 200 request for every month or just for one time 200 requests?

  • @saisashreek9249
    @saisashreek9249 7 месяцев назад

    Hey i have used your codes but for gmails it says queued.

  • @great7527
    @great7527 10 месяцев назад +1

    Hello, how can I message you directly?

  • @DrugNStyleMUFEVO
    @DrugNStyleMUFEVO Год назад +1

    the pass inside the auth is the login pass? or something that the SMPT2GO provides?

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      The pass is the regular password for your email account, though for some services such as Gmail you now have to use an 'app password' for security reasons. You can do this for Gmail in the security section on your main account after enabling two-factor authentication.

  • @geminiatwork
    @geminiatwork Год назад +1

    Hi is there any tutorial how to send attachment via file input?

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      I have a tutorial on how you can get a file in Node.js from a file input on the frontend:
      ruclips.net/video/TZvMLWFVVhE/видео.html
      Then you can send the received file as the attachment instead.

  • @devngecu
    @devngecu Год назад +4

    How do you go about with the "less secure app access " feature that was removed from May 2022?

    • @360-jatin6
      @360-jatin6 Год назад +1

      Same doubt

    • @OpenJavaScript
      @OpenJavaScript  Год назад +6

      Seems that for Gmail now, you need to enable two-factor authentication on your Google account and, after that, generate an app password (you should be able to manage all of this in the security section of your account). Then, use this password instead of your regular one in Nodemailer.

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      @@360-jatin6 See my response to the first comment

    • @idrin6799
      @idrin6799 Год назад +1

      @@OpenJavaScript Works fine, thank you!!

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      @@idrin6799 Nice, you're welcome!

  • @Seedley
    @Seedley Год назад +1

    how are you able to use your custom domain instead of a gmail domain?

    • @OpenJavaScript
      @OpenJavaScript  Год назад +4

      In case you don't have one already, you'd need to purchase a domain. These can be quite cheap if you don't want an in-demand one (I just checked and see domains falling into this category selling for $15 per year).
      Then you'd need a server connected to that domain. For this, I'd recommend shared hosting as this can be an afforable solution as long as you are not planning on running a heavy-bandwidth service.The hosting provider I currently use (also in the video example) is HostWithLove: bit.ly/3V2RM9Q
      You can also purchase a domain through HostWithLove and ask them to connect it to your hosting if you decide to go with them.

    • @colindante5164
      @colindante5164 4 месяца назад

      @@OpenJavaScript Thanks for the tutorial and sharing your hosting provider. Hope they'll be able to host my node app. cheers))

  • @user-rn7nv8xl7d
    @user-rn7nv8xl7d Год назад

    hello, sending to multiple recipient puts all addresses in the 'To' field, please how can they to individual recipient

    • @user-rn7nv8xl7d
      @user-rn7nv8xl7d Год назад +1

      ok got it, i changed to bcc

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      Nice, thanks for posting the solution so maybe someone with the same issue comes across this :)

  • @zachariantsoditalakgale4025
    @zachariantsoditalakgale4025 19 дней назад

    thank you

  • @karim7788
    @karim7788 Год назад

    How can i get my company's SMTP server hostname?? Plz help

    • @OpenJavaScript
      @OpenJavaScript  Год назад

      If you have cPanel access, you can get it by accessing an email account through it and then -> Webmail Home -> Configure Mail Client.
      You should be able to see the SMTP server information there.

  • @GaganDeepSingh-mg8hl
    @GaganDeepSingh-mg8hl Год назад +2

    bro when i use this in vps server, it shows error like : Error: Missing credentials for "PLAIN", what can i do for that

    • @OpenJavaScript
      @OpenJavaScript  Год назад +1

      I'm not certain but some things you can try that may help but are NOT secure, deployment applicable solutions:
      - Try disabling adblocker when testing
      - Add the following property to the transporter (warning: allows your app to connect to untrusted sites without a certificate):
      tls: { rejectUnauthorized: false }
      Also, make sure your source code matches mine by using the one posted here:
      openjavascript.info/2023/01/10/nodemailer-tutorial-send-emails-in-node-js/

    • @GaganDeepSingh-mg8hl
      @GaganDeepSingh-mg8hl Год назад +3

      @@OpenJavaScript bro i did a mistake that i didnt have my .env on my server 😂😂

    • @OpenJavaScript
      @OpenJavaScript  Год назад +2

      @@GaganDeepSingh-mg8hl OK, glad to hear it's resolved!

    • @cloudsystem3740
      @cloudsystem3740 Год назад

      try const transporter = nodeMailer.createTransport({
      host: process.env.MAIL_HOST ,
      port: 587,
      auth: {
      user: process.env.MAIL_USER,
      pass: process.env.MAIL_PASSWORD
      },
      tls: {
      rejectUnauthorized: false,
      minVersion: "TLSv1.2"
      }
      });

    • @muhammadsharif5526
      @muhammadsharif5526 10 месяцев назад

      In create transport function you should pass in auth object instead of password