Nodemailer - Send Emails From Your Node.js App

Поделиться
HTML-код
  • Опубликовано: 7 сен 2017
  • In this video we will create a simple Node.js and Express app and implement the Nodemailer module to add a contact form.
    CODE: Complete Node app repo
    github.com/bradtraversy/nodec...
    ORIGINAL HTML/CSS FORM DOWNLOAD:
    www.traversymedia.com/download...
    INMOTION HOSTING SIGNUP:
    inmotion-hosting.evyy.net/c/3...
    BECOME A PATRON: Show support & get perks!
    / traversymedia
    ONE TIME DONATIONS:
    www.paypal.me/traversymedia
    COURSES & MORE INFO:
    www.traversymedia.com
    FOLLOW TRAVERSY MEDIA:
    / traversymedia
    / traversymedia
    / traversymedia
  • НаукаНаука

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

  • @scholtzgnomie
    @scholtzgnomie 3 года назад +194

    Video starts at 22:00 for those who are familiar with the basics of Node and Express.

    • @kevaimm1700
      @kevaimm1700 2 года назад +6

      i wanna upvote you so bad, but it says 69, so take this as an upvote :)

    • @tahid9688
      @tahid9688 2 года назад

      thanks

    • @aliaalmsouti5370
      @aliaalmsouti5370 2 года назад +3

      thanks time saver

  • @praveenbadigerv
    @praveenbadigerv 6 лет назад +152

    Guys, don't skip the ads that play on this channel. It will help the channel. I used to skip the ads in the beginning as I wasn't aware of it. Thanks Brad for these awesome videos. Cheers! 🍻

    • @shando_tube
      @shando_tube 6 лет назад +3

      In order for the RUclipsr to get compensated for the ad, you must either sit through 30 seconds of the ad or through the completion of the ad - whichever one comes first.

    • @AdamTillontheWeb
      @AdamTillontheWeb 6 лет назад +1

      Not sure this is actually true. Otherwise the RUclipsr is being held accountable for how good the ad actually is, which isn't the case. Would like a reference for this otherwise, since I've heard that it doesn't matter to the channel owner (they just decide how many commericals/where they're placed)

    • @TenaciousDanR
      @TenaciousDanR 5 лет назад +6

      Ads? What are those? I never see them thanks to AdBlock. I dont think that google would let you skip ads by default anyways...

    • @bradical8198
      @bradical8198 5 лет назад +2

      If he splits the compensation 50/50 with me :)

    • @neenus
      @neenus 4 года назад +5

      @@bradical8198 He's splitting the compensation with you by taking the time to make these videos and share his knowledge with you for free!

  • @strikerwow2011
    @strikerwow2011 4 года назад +11

    DUDE i was searching for 3 days and then I saw you and I remember how cool your videos are!! Thank you!
    Bloody Hell you really are the best!

  • @devonkiss
    @devonkiss 6 лет назад +1

    Just about the only tutorial I've seen where I was able to roll through a test email on the first try. Kudos my friend.
    *Please make sure to use environment variables when going live. Search for environment variables for NodeJS and you should have no problem you don't wanna expose your credentials to the world!

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

    Just started my journey in to backend and wanting to put a contact form on my portfolio. This is awesome, thank you for this. I realize this is about 5 years old at this point but I’m subscribing and looking forward to you new stuff.

  • @abdallahrizk8787
    @abdallahrizk8787 6 лет назад +6

    mate I have been searching for such a tutorial for a long time, Thanks. One of the best if not the best javascript tutorials channel highly recommended to subscribe

  • @Algebrodadio
    @Algebrodadio 6 лет назад +1

    Beautiful. I had to go figure nodemailer out for my Heroku app. And then this vid comes out. I wish I had it two weeks ago!
    Nice work Brad.

  • @danielsigut2855
    @danielsigut2855 6 лет назад +5

    Brad, you have helped me immensely. I was finding outdated posts on how to use Nodemailer. I finally came across your video and got my form to work. You are awesome and deserve way more than 183K subscribers. I hope you get to one million. Keep up the good work, and you've gained a subscriber :)

    • @TraversyMedia
      @TraversyMedia  6 лет назад +3

      Thank you very much :) hopefully someday

    • @JuaNeMe
      @JuaNeMe 3 года назад

      @@TraversyMedia lol, You already did it :)

  • @asmrdonk3951
    @asmrdonk3951 5 лет назад +12

    Every time I look for a web design tutorial, you're the best one that comes up. Thanks so much!

    • @meteachesprogramming9395
      @meteachesprogramming9395 4 года назад +4

      hey bro this is not web designing this is backend development.

    • @nyxtech8692
      @nyxtech8692 2 года назад

      @@meteachesprogramming9395 Design or Dev does it really matter if your learning?

  • @roopegarcia
    @roopegarcia 6 лет назад +4

    Thanks Brad you a re a lifesaver. I've learned so much from you and can't thank you enough for all the free work you do for us. Your new web site is top class. Would like to see how you created that shrinking menu, those animations and milestones. If you don't have anything else going on right now, :)

  • @prateekcool3
    @prateekcool3 6 лет назад +2

    Damn! I so wanted this since so many days! Traversy came to rescue again. Thanks man!

  • @up4life108
    @up4life108 6 лет назад +1

    I don't know how, but you always find the most interesting topics for your videos !!

  • @bradical8198
    @bradical8198 6 лет назад +1

    I wish my Udemy course oulined a lecture like this, everyone in the course expected to see something like this! Great video!

  • @user-zg3vt6zh6y
    @user-zg3vt6zh6y 6 лет назад

    man you are awesome!
    i looked all forums in my country, but not found needed info
    thanks a lot!

  • @greggsworld4453
    @greggsworld4453 5 лет назад

    Thank you! The tls: false trick is what I came here for. Much appreciated.

  • @maddutchess5312
    @maddutchess5312 5 лет назад

    Thank you for all the tutorials, Brad. Keep 'em comin'.

  • @SatyamShivharey
    @SatyamShivharey 3 года назад

    Finally I found someone with real knowledge. I was looking for this video all over the internet but people were always using some crap like mailgun with nodemailer. Thanks man, this video really helped me a lot :)

  • @papaOhmTV
    @papaOhmTV 5 лет назад

    Another one of them best and helpful tutorials on youtube.. Thanks Brad Traversy!!!

  • @pamelahicks
    @pamelahicks 6 лет назад +26

    Great explanation, and thank you for not using the gmail smtp!

  • @eristoff3782
    @eristoff3782 6 лет назад

    Best educational content related to web development on RUclips. By far.

  • @SmallvilleJW
    @SmallvilleJW 4 года назад

    Thank you so much, Brad! This video helped me configure Nodemailer for our production application.

    • @goodluckboy9439
      @goodluckboy9439 4 года назад

      Mr Joshua, can I propose a business ? my email is it.dept@cresentdecal.co.write me and I will explain further . Thanks Window controlAbouti

  • @bradbaguyo7374
    @bradbaguyo7374 5 лет назад

    Exactly what I'm looking for. Thank you Brad!

  • @mikepauls6008
    @mikepauls6008 4 года назад +233

    For anyone having an error similar to "Error: ENOENT: no such file or directory, open '/mnt/c/users/name/Email/views/layouts/main.handlebars'", Use res.render('contact', {layout: false}); instead of res.render('contact');

  • @user-dc6bt8dt2g
    @user-dc6bt8dt2g 2 года назад

    I started studying after watching a lecture on Udemy. You are always helpful. thank you.

  • @theresashen1327
    @theresashen1327 3 года назад

    Exactly what I was looking for. Thank you Brad!

  • @razashah9040
    @razashah9040 4 года назад

    Hey Brad! You are a life saver.This tutorial really helped me out.

  • @jitendrakr
    @jitendrakr 6 лет назад

    Your videos are very good. Short, crisp and very informational. I have become your subscriber. Thank you.

  • @quamzgraphix9826
    @quamzgraphix9826 3 года назад

    Best programming tutor online, thank you very much for this video, it's really helpful

  • @mikejackson8463
    @mikejackson8463 2 года назад

    Dude! I've been beating me head against a wall for 4 days. This example totally helped me figure out what the issue was. Thanks so much.

    • @2breborn247
      @2breborn247 2 года назад

      This makes me feel a bit better XD

  • @Mashtre
    @Mashtre 6 лет назад

    Great video man, you've helped me a lot with this topic. Hope you make more videos on node ect.

  • @ozzyfromspace
    @ozzyfromspace 3 года назад +3

    You made it so easy for me to understand how nodemailer works! Thanks to you, I've successfully implemented nodemailer into my portfolio project (verifying an email address for an express app). You rock, Brad! Seriously, you do!

    • @ludaxofficial
      @ludaxofficial 3 года назад

      im having an issue integrating this into my existing portfolio, could you pleasae help me out?

    • @ozzyfromspace
      @ozzyfromspace 3 года назад

      @@ludaxofficial hi, I can try. What’s not adding up?

    • @ludaxofficial
      @ludaxofficial 3 года назад +1

      @@ozzyfromspace thanks for responding quickly! So, im implementing this back end code into my website and i dont understend if i have to put all my html into the contact.handlebar or only the html of the form.

    • @ozzyfromspace
      @ozzyfromspace 3 года назад +1

      @@ludaxofficial hi, do you wanna meet on jitsi. It’s an opensource video platform where people can chat in real-time without creating an account?

    • @ozzyfromspace
      @ozzyfromspace 3 года назад +1

      The approach I would generally recommend is to have an html form so you can post inputs to an app.js type server. Then copy-paste the node-mailer code and replace their test account with your own, and pass an html object (scoped to a div) to the html field. Hopefully this helps. It’s hard to say more without seeing relevant parts of your code.
      I’m online watching a lecture so I’ll see your response if you’re quick enough (within the next 40 minutes or so). Best wishes

  • @naomim1207
    @naomim1207 6 лет назад

    Your video is amazing. It helped me a lot. It is for sure the best video I've watched on this subject. Thank you for helping others :)

  • @freston75
    @freston75 6 лет назад

    You are the man! I really enjoy your content! and you always put out relevant topics keep it up!

  • @rashmiupadhye6444
    @rashmiupadhye6444 3 года назад

    Thanks a lot ! it worked with one or two changes.But your code helped me!

  • @manojsingh6294
    @manojsingh6294 5 лет назад

    Thanks dude! its amazing , quick and simple explanation !

  • @inhibited44
    @inhibited44 2 года назад

    Thanks. Glad you mentioned you didn't use SSL. My website mentions different parameters for no SSL. I have one website on one host with email and another on heroku with no email. I got it so the code in heroku will use the system on my other website to send emails as needed. Cool!

  • @gillesmosson
    @gillesmosson 5 лет назад

    Super video, thank you Brad, it works perfectly, even with firebase

  • @yash6680
    @yash6680 6 лет назад

    i was stuck using smtpTransport and stuff but your video made it so simple.. thank you very much !! ^_^ ^_^ ^_^

  • @markdurksen6589
    @markdurksen6589 4 года назад +2

    This was mad helpful. Thank you 1000x.

  • @mateuszzdyb3547
    @mateuszzdyb3547 4 года назад +1

    thank you sir! your tutorial helped me a lot!

  • @subhadipdutta4074
    @subhadipdutta4074 4 года назад +1

    your videos like this,image upload, authentication,session help me in build my major project.....thank you sir...

  • @1995jozef
    @1995jozef 5 лет назад

    Thanks Brad for these awesome videos. Cheers!

  • @edd338
    @edd338 5 лет назад +1

    Looking forward for the series on hosting!

  • @Joshua-ef7cl
    @Joshua-ef7cl 3 года назад

    Thanks man! Really awesome video, it really helped me out, very grateful :)

  • @btcblade3334
    @btcblade3334 5 лет назад

    awesome piece of content, def saved me alot of time. Thanks brah!

  • @nicolaszambranomadero9715
    @nicolaszambranomadero9715 4 года назад

    Excelent Video it help me so much to understand nodemailer, Thanks.

  • @albertoarielarce2982
    @albertoarielarce2982 3 года назад +1

    Thank a lot, this video was very helpfully to me!!!

  • @campusdee391
    @campusdee391 6 лет назад

    Awesome video mate! best nodemailer video on the web

  • @paulcryan9288
    @paulcryan9288 4 года назад

    Well done, great video and presentation. THX Paul

  • @alessandromuratore8431
    @alessandromuratore8431 2 года назад

    It's help me a lot! Thank you for sharing

  • @itsamirkhan
    @itsamirkhan 4 года назад +1

    Congratulations to reach 1 Million :D You deserve

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

    Thanks for sharing. I learned something new from this video

  • @jacobtherobertson
    @jacobtherobertson 5 лет назад

    Just found your channel. It's great!

  • @th3Phenomenon
    @th3Phenomenon 6 лет назад

    Loving your Bootstrap 4 course s far. I would love to see you do something on Progressive web apps

  • @PandemicGameplay
    @PandemicGameplay 6 лет назад +18

    one tip for actually planning on using this live: you can setup system environment variables through your web deploymsnt service (example Heroku) that way you can use those in place of actual usernames passwords for better security.

    • @TraversyMedia
      @TraversyMedia  6 лет назад +5

      Thanks

    • @PandemicGameplay
      @PandemicGameplay 6 лет назад +1

      Np! btw I love your videos. You practically taught me MEAN JS. Great work!

    • @InphaMyllz
      @InphaMyllz 6 лет назад +1

      are you able to get this to work in production? im getting 503 response code, even though it works locally

    • @morriswarachi
      @morriswarachi 6 лет назад

      Mine too doesn't work. I hope someone has been able to solve this.

    • @agentklodovsky2591
      @agentklodovsky2591 5 лет назад

      how?

  • @PedroSouza-oz3su
    @PedroSouza-oz3su 5 лет назад

    Thank you very much dude, your videos are so helpfull, i love your work.

  • @Mattyx35
    @Mattyx35 6 лет назад

    Thank you! I've learnt a lot of interesting things on your channel!

    • @bondstar927
      @bondstar927 4 года назад

      consider becoming a patreon

  • @elipeters5658
    @elipeters5658 6 лет назад

    Love the vids!
    One tip is nodemon doesn't require the file extension "node app"

  • @dorsolomon7251
    @dorsolomon7251 6 лет назад +39

    Awesome video, would like to see one on payment system.

    • @prateekcool3
      @prateekcool3 6 лет назад +3

      Dor Solomon Stripe is Best and it is very easy to integrate.

    • @SogMosee
      @SogMosee 6 лет назад +1

      Yep, i have working code if you want to see it.

    • @dorsolomon7251
      @dorsolomon7251 6 лет назад

      SogMosee yes that would be great.

  • @Thesrik23
    @Thesrik23 6 лет назад

    Love you Brad! The man of web.

  • @danielchen2968
    @danielchen2968 4 года назад

    I have learned a lot from you, thank you !

  • @tebogotau
    @tebogotau 5 лет назад

    Brad! Awesome... All the videos. Thanks

  • @corneliusisaac6539
    @corneliusisaac6539 3 года назад

    This was very helpful even if I had to watch this in the future.

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

    Thank You . it is really usefull and easy tutorial,

  • @BrianArtea
    @BrianArtea 3 года назад

    I must have went through 15 tutorials and finally I got it to work with your video! Thank you. I had to actually put the form inside of view/layouts/main.handlebars and it worked. How do I actually get it to work on a shared hosting server? I to am using inmotion hosting.

  • @awesomelycurious2740
    @awesomelycurious2740 5 лет назад

    Thank you so much for such valuable information!

  • @vNoComments
    @vNoComments 5 лет назад

    You rock man!! Very helpful stuff!

  • @bonnyboy23
    @bonnyboy23 6 лет назад +1

    I would recommend using yarn package manager as it's much quicker and I find it cleaner to use.
    Love the content, really well taught !

  • @kayodeemmanueladetunji3367
    @kayodeemmanueladetunji3367 6 лет назад +9

    On a lighter note, I think the dislikes you get might be from old grudges, probably your exes. How on earth would your videos have dislikes, not even from competitors! Thumbs up Brad!

    • @goodluckboy9439
      @goodluckboy9439 4 года назад

      Mr Kayode can I propose a business ? my email is it.dept@cresentdecal.co.write me and I will explain further . Thanks Window controlAbouti

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

    This is 5 years old but still good, thanks

  • @jordimuntadagomez816
    @jordimuntadagomez816 4 года назад

    You're awesome Brad! Thank youuuuu

  • @gildedking4787
    @gildedking4787 6 лет назад

    Very helpful thank you so much for the video!

  • @RobFera
    @RobFera 6 лет назад +1

    Thank you man, really helpful tutorial! I managed to make it work with Gmail.

  • @lightinthedark5708
    @lightinthedark5708 4 года назад +1

    Your video better than Game Of Thrones! Thanks!

    • @goodluckboy9439
      @goodluckboy9439 4 года назад

      can I propose a business ? my email is it.dept@cresentdecal.co.write me and I will explain further . Thanks Window controlAbouti

  • @reyfuertes135
    @reyfuertes135 6 лет назад

    Thank you, this save my day.

  • @mislavcrnkovic3467
    @mislavcrnkovic3467 3 года назад

    This is awesome! Great job!

  • @abhishekmazumdar2072
    @abhishekmazumdar2072 5 лет назад

    you got 6 monitors? Brad you're a legend..

  • @michaelharris8040
    @michaelharris8040 2 года назад

    Thank you for a great video. Appreciate you!

  • @JS-pg7eq
    @JS-pg7eq Год назад

    Thank you, Brad! Considering the frequency by which Node, NPM etc are updated, could you please indicate which versions you are using? Thank you so much!

  • @SiddharthRay1
    @SiddharthRay1 6 лет назад

    thanks a ton for this important tutorial.

  • @andrewtaylor1626
    @andrewtaylor1626 5 лет назад

    good vid, worked for me. like well deserved.

  • @IdreesDargahwala47
    @IdreesDargahwala47 6 лет назад

    Loved this video.
    Wanted to implement nodemailer and you helped me.
    One question.
    Can we hide or wrap it up the username and password so that i can upload the code on Github ?

  • @gindevgin9298
    @gindevgin9298 3 года назад

    Wow! Great as always!

  • @nicholasdittmer4494
    @nicholasdittmer4494 2 года назад

    Excellent tutorial as always. It was that tls thing that had me stumped. Do we need to remove that for production?

  • @MrBasie1234
    @MrBasie1234 4 года назад

    Hi Brad, thanks for all the videos, we appreciate it. Hope you can help just on how to get all the dependencies installed at a node.js host ?

  • @ndahayokevin7626
    @ndahayokevin7626 2 года назад

    Father of Many developers Because of his content

  • @RaulGarcia-ei6cl
    @RaulGarcia-ei6cl 5 лет назад

    Hai Traver, thanks for your great video! I was wondering if i can use the 'messages send successful' or 'failed to send messages' with template engine EJS instead. How can i use the variable for ejs template system?

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

    Thank you, Brad!

  • @1kebastuz
    @1kebastuz 6 лет назад

    Thx for this.
    Also would be great to see something game-like with nodejs+socketio. Simple gameapp, like scissors-paper-rock or something (there is one actually on youtube), but with your style of explaining stuff.

  • @luisquinones8362
    @luisquinones8362 6 лет назад +1

    Thank you Brad!

  • @tiagofernandes801
    @tiagofernandes801 4 года назад

    Thank you!!!
    Nice Tutorial

  • @ati2757
    @ati2757 3 года назад

    Hi Brad, Thank you for your helpful tutorials. Is it possible to use nodemailer without auth?

  • @nekromanser88
    @nekromanser88 6 лет назад +1

    Thank you for the video. Can you do the same with using a React component and Express?

  • @JustCallMePCra
    @JustCallMePCra 6 лет назад

    THANK YOU!!! I HAVENT WATCHED IT YET BUT, I ALREADY LOVE IT!

  • @arrowb
    @arrowb 6 лет назад +1

    thanks brad for this awsome tutorial, however what to do next at hosting.. means that enquiry.handlebars is not going to as index file...

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

    thank you very much is very helpful😁

  • @JorgeDev92
    @JorgeDev92 6 лет назад

    Yesterday I implemented Nodemailer in my sandbox node + angular app for learning, what a surprise to see now that your video is about nodemailer. XD

  • @purushothaman281
    @purushothaman281 5 лет назад

    bro You are simple super , video was very clear and very neat so thankfull

    • @goodluckboy9439
      @goodluckboy9439 4 года назад +1

      Mr Purush can I propose a business ? my email is it.dept@cresentdecal.co.write me and I will explain further . Thanks Window controlAbouti

    • @purushothaman281
      @purushothaman281 4 года назад

      @@goodluckboy9439 email id not found brother , you can reach me on insta

  • @SharePinPoint
    @SharePinPoint 4 года назад

    Thanks man! I couldnt get the handlebars thing going.......Managed to push it by directly sending over the html.....Overall very precise and good!

    • @oscheka
      @oscheka 4 года назад

      Hey could you in depth explain how you managed to fixed it?
      Errors below when I send from the form
      Message sent:
      Preview URL: false
      Error: ENOENT: no such file or directory, open 'C:\Users\Brad\Desktop\Brad_Traversy\Node_imail\views\layouts\main.handlebars'

    • @SharePinPoint
      @SharePinPoint 4 года назад

      @@oscheka
      //Static Folder
      app.use('/public',express.static(path.join(__dirname,'public') ));
      app.use(cors());
      app.get("/",function(req,response){
      response.sendFile(path.join(__dirname+'/public/index.html'));
      //response.sendFile("/views/index.html");
      });

    • @ludaxofficial
      @ludaxofficial 3 года назад

      @@SharePinPoint hi there, so did you put your html into both public folder and views folder? also, did you put all your html or only the form html? thanks a lot!

    • @SharePinPoint
      @SharePinPoint 3 года назад

      @@ludaxofficial check the last line of the code. Its almost an year now
      But I think as the last line suggests in views folder. Entire html file including the code

  • @prashantpatel7964
    @prashantpatel7964 3 года назад

    Thank you so much Brad. Learning a lot from u. I made nodemailer work with my contact-form in portfolio-site. Now I am not getting how to deploy on my hosting provider(hostinger.in). Or is this provider not supporting node?