How to Send Emails with Python [New Method 2023]

Поделиться
HTML-код
  • Опубликовано: 15 окт 2024

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

  • @ThePyCoach
    @ThePyCoach  Год назад +10

    For those asking. Here's how you can add attachments and send emails to multiple receivers: ruclips.net/video/ANCKLzvvO5A/видео.html

  • @EngineerFormidable
    @EngineerFormidable 2 года назад +87

    Works perfectly, thank you. Literally spent 3 days looking for something as simple as this. Thanks a lot !

  • @thisoldfox
    @thisoldfox 2 года назад +14

    I too spent many days trying to create emails with Python and this video showed me how. Thanks for the great video.

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

    I spent almost a month trying to find a solution for this, and in less than 10 minutes I found the solution. Thank you for this tutorial.

  • @southvillechris
    @southvillechris 11 месяцев назад +3

    Fantastic video - thank you so much! I've been banging my head against a wall trying to send smtp messages - and this one actually worked!

  • @labscience8271
    @labscience8271 2 года назад +14

    Thank you! I sent my first automated mail, and I have some plans to do with it. Very good explanation!

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

    Worked perfectly. I wasted 4 hours yesterday trying to get this to work with a much more complicated method involving setting up an SMTP server on localhost, which did not work.

  • @siarnt3566
    @siarnt3566 2 года назад +5

    You are the GOAT for this video. I had a site that was running for so long sending emails with the "allow third party" setting on Gmail. Ever since they removed that feature I couldn't get it to work and all the other tutorials on RUclips were made before this was the case.
    Thank you so much for releasing this video promptly. I will definitely be checking out some more videos in the future!!

    • @ThePyCoach
      @ThePyCoach  2 года назад +2

      Yeah I know. That gave me extra motivation to make this video. Good timing!

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

      @@ThePyCoach What do you do if it sends the email, but it just goes straight to junk mail? Does it matter which phone/browser you use? I noticed with iphone just sent email straight to junk, but android didn't

    • @-potato-god-2311
      @-potato-god-2311 Год назад

      @@wcsdiaries I'm guessing your iPhone has some option enables which sends automated messages into junk. I'm not too sure about it.

  • @MsNd4Spd
    @MsNd4Spd 2 года назад +2

    After a whole week of trying out other methods, this one worked perfectly.

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

    Took me so many failed attempts until I found your video. Worked first time, Thanks!!

  • @deekshantwadhwa
    @deekshantwadhwa 2 года назад +20

    Great work man, an IT company that my Dad uses in his office was asking for $5000 for this upgrade in the software they created for his office. After searching for the reason why the emails had stopped working from their software, what changes has Google brought forward and the fix (your video), I had a "chat" with them, and guess what, new budget = $100 which is still too much, but their mails are now working back again through their software. #KnowledgeIsPower

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

      Why dont you guys use services like msg91 its much better

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

      if the dev is in India - okay, otherwise you're just a cheap guy who should learn how to code

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

      wow

  • @sakethkumarpeddi2089
    @sakethkumarpeddi2089 2 месяца назад +1

    Man. You are just awesome. I've spent almost half of my day on how to send emails with free SMTP services. Thank you, Thank you so much. 😊

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

    Thank you so much, Frank.
    My first Automated email was a success.

  • @Raizun
    @Raizun 7 месяцев назад +2

    Thank you a lot! The best guide. Easy to write and it actually works!

  • @uscbruin213
    @uscbruin213 2 года назад +2

    Amazing! I was searching Google and stack overflow for this all day and then watched your video and it was simple!

    • @ThePyCoach
      @ThePyCoach  2 года назад +2

      A couple of months ago I was searching like you and after hours I read that Google had changed his security ... in that moment I understood why the old tutorials didn't work

  • @scale...3d
    @scale...3d 2 года назад +1

    Ah, finally, it works. The good thing about this method is that I can use it with my main email rather than making a new one with security off.

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

      I think that’s the reason why Google removed the other option

  • @RodrygoDeSilva
    @RodrygoDeSilva 2 года назад +2

    Thank you so much bro but I have one question. I am getting a exited with code=1. I'm sure that means that there's one line of code that's wrong but I rechecked everything with your video and it matches yet I'm getting an error. Any advice you can give me? thanks.

  • @JohnMcGuckin-e9y
    @JohnMcGuckin-e9y 8 месяцев назад

    been looking for a way to send emails in Python for ages, thanks for this!

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

    I couldn't make flask-mail to work. This option made my day after 2 days of getting frustrated it! THANK YOU!!

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

    When someone and sits to explain it, it is so much easier. Was able to fix my code with this.

  • @marronnier17
    @marronnier17 Месяц назад

    Thank you so much. You made a complicated ( for me) topic very straight forward. It worked first time. Of course Google has changed some of it's gmail setting screens and menu but otherwise perfect. Thanks again.

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

    Thank you, literally no other tutorial is up to date and clear like this one

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

    i don't even know how to say how thankfull i am for this video, i've benn trying to find the solution for past 2h thx so much

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

    This video tutorial is very helpful, I followed and it worked, it solved the problem of "less secure app access" that google has no longer support that feature since May 30, 2022. Thank you for guiding us

  • @TechnoSpirit
    @TechnoSpirit 2 года назад +2

    Bless the creator of this video! An infinity of thanks will not be enough!

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

    Thanks man! I was trying to figure the hell out when I was not getting my credentials right in the beginning. You perfectly explained the right way to get the password

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

    My god it worked! Thank you so much i was not expecting it to work that simple!

  • @brucenelm
    @brucenelm 5 месяцев назад

    Thanks for sharing the video! I'm curious, do you think there's a risk of the emails getting flagged as spam?

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

    Will use this to bulk-email my teachers whenever I’m too lazy 😂 thank you!

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

    Works perfectly sir , i am a Data science student . That new Google policy made me sad . This video helps me a lot to complete my project

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

    I love you man, thank you so much! I appreciate you mentioning how to handle the SSL VERIFICATION ERROR!

  • @richardbrakoh4154
    @richardbrakoh4154 2 года назад +2

    I did the code the same on my house windows laptop and it works fine. However when I coded on my MacBook Pro, there was an error which says “No module named email.message; email is not a package “. Why is that?

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

    Really helped me to automate my mail triggers! Thanks for your content

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

    thanks for the process to link the account with google I was facing too many errors this video solved it like it was nothing. I think I should question myself first.

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

    Amazing content with step by step walk throughs for an absolute beginner. Thanks so much!

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

    thank you so much old method was working for me when i change my email id it was not working due to google update but now i dont need to use google gmail api and you saved lot of time

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

    Thank you so much for this video man. Was literally pulling my hair trying to get this done. Thanks again.

  • @Ramlakhan-25
    @Ramlakhan-25 8 месяцев назад

    this works! Thank you.
    Just one question, how we can use this for sending bulk emails separately to each user without keeping them all in one email?

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

    Thank you very much! Worked on the first time

  • @grigorijdudnik575
    @grigorijdudnik575 9 месяцев назад +1

    Hey Frank, thanks for clear tutorial, It helped me to finally did that. I have little remark for it: as you hidden your app password, it was not obvious if words in password should be separated by spaces, or written in common, or even separated other way (after test I have response: spaces are ok). I suggest to make it more explicit, maybe next time to use some password which you'll delete before publishing the video.

  • @NebesnyPlamen
    @NebesnyPlamen 5 месяцев назад

    Awesome, thank you. This new method isn't harder than the old one

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

    For someone who is starting, this tutorial helped me alot

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

    Thanks alot, I was really tired of the TimeOut Error. God bless you

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

    This worked!! I spent so many days to find out a way. Thank you so much🤩

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

    THANK YOU!!! I've been looking for a way to do this for days.

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

    love you man you brought me out of this big struggle

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

    Thanks, A simple and accurate step by step explanation. Works perfectly.

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

    The video is very informative, but while following along I am getting the error "Application-specific password require". Though I have generated the app password in the gmail and 2-step verfication is also on. Could anyone help? Thanks in advance

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

    Thanks! Got my Email program working again.

    • @ThePyCoach
      @ThePyCoach  2 года назад +1

      You're welcome! More automation videos coming soon

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

    Thanks very much, I have been struggling with how to do this for a while !!

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

    Works perfectly but how about sending to bulk email, like having a list of emails in a txt/csv file and sending via python. I will appreciate your response. Thanks 💖💖💖

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

    WHy everyone in the forums suggest complicated solutions and you, on the other hand, have solved all my problems so easily? THANK YOU

  • @francislau9292
    @francislau9292 Месяц назад

    I have problem creaite a app passwords - there was an error generating an app password.
    I have tried below methods:
    1) signing out all others google account while creating app password
    2) Using a different IP while attempting creating app password.
    Yet I still have this error message popping up. Do you have any recommendation please?

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

    This video saved my ass, I was so frustated when a project which I made about 2 years ago broke. First it took me time to realize why it was breaking then I saw that google changed its policy. Anyways thnx.

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

      You're welcome. Just today I uploaded a new video about this. The method is still working. I just added more things like how to add attachments and send emails to multiple receivers!

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

    Nice video. Worked flawlessly.
    Thanks for this great content!

  • @technicalaasaan633
    @technicalaasaan633 2 года назад +1

    thank you... I tried many way all are outdated one.

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

    It works great. After spending a lot of time looking for a solution finally I got in here, thank you very much for this video.

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

    Nice video, thanks! However, that apppasswords url does not work for me. It's odd that you edit the URL like that, instead of going via the google account page: Security -> 2 step verification -> scroll to bottom -> you will see App Passwords. Click, when you get there I get essentially the same as you, but I can't select a specific app and language, i can only create a generic app password.

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

    can this method be used to send bulk email for marketing?

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

    Very helpful and straightforward video. Thanks!

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

    Thanks a lot, this cured a headache I was having on this problem.

  • @alderiatefanclub1576
    @alderiatefanclub1576 Год назад +3

    Thanks a lot ! Your video is crystal clear and helpful :)

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

    Thank you so much I've been at this for days.

  • @JamesLee-99990
    @JamesLee-99990 Год назад

    If at your work, you've developed a python web scrapping, and you want to setup an email alert/notification if the web scrapping program fails. How you develop an email alert/notification?

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

    Will the 'To' key accept a list of emails (or a string of multiple emails), or is a loop needed for multiple recipients?

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

    Thanks for this video. That was really useful for me. I have done it and found zero error. Please also make a video for emailling with attachments.

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

    thanks a lot! your method is the only one works so far. wonder how I can add an attachment to the email with this method?

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

    Thanks a lot! If I may ask, how would you go about sending an attached file through this method?

  • @ShaikhAsif-u7r
    @ShaikhAsif-u7r 10 месяцев назад +1

    Thanks for this video

  • @revanthreddy9781
    @revanthreddy9781 2 года назад +2

    For email.message which package is necessary to install?...

  • @1uffyD9
    @1uffyD9 2 года назад

    Were you able to find a method or a proper alternative to add Bcc emails?

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

    updating 2023: it's still working!

  • @andreviniciusbezerradasilv9335

    how can i send that email to multiple receivers ? I can store the other receivers in a list or just write a string with all the emails ?

  • @ОлександрБілоус-м5ъ
    @ОлександрБілоус-м5ъ 7 месяцев назад

    Thank you for google settings part!

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

    PHPMailer works perfect too, thank you.

  • @kishore.l3550
    @kishore.l3550 9 месяцев назад

    Nice clear video. BTW Quality of life change, we can use TLS protocol for security and it is much more easier to do.

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

    Plain and simple, thank you.

  • @another-niko-pfp-holder
    @another-niko-pfp-holder 2 месяца назад

    What if I want to write the script for myself and never share it, should I also save the password as an env variable?
    (also thanks for the tutorial, exim don't want to work so this is very useful for me)

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

    Can you please help me? I am having some issues. It's saying.
    Traceback (most recent call last):
    From email message import: EmailMessage
    ImportError: cannot import name EmailMessage

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

    Thank you so much! This video was amazing. Please don't stop doing this kind of tutorials

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

    Really made the hard task easy

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

    HI bro i am getting an error in my code and i tried everything please tell me how can I get rid of this error:TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.please tell me what is wrong with my code and how i can correct it?

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

    when i run the file i always got this error : No module named 'email.message'; 'email' is not a package
    I intall pip email but it still dont work, can someone help me please

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

    I have a question... Is there a risk of your mail being sent to the spam folder?

  • @miguelgarcia-vg1fh
    @miguelgarcia-vg1fh Год назад

    Did not work for me. I get time out error: [win error 10060] a connection attempt failed because the connected party did not properly respond....
    Any tips?

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

    I have 2 email ids loaded in my outlook. One is shared mail box. Plz let me know how i can send email using shared mail box. It do not have any password. Plz help

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

    you are a GOAT, the only tutorial that worked

  • @vuinhduy8314
    @vuinhduy8314 5 месяцев назад

    Dear Sir,
    I'm appriciate your content. Help me alot to cut my work time.
    Best wish to you.

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

    can you help me understand the password bit? so we create an app password that will allow python to use it for the smtplib library, with this generated 16 character password if it gets leaked, would people be able to log into my gmail account?

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

    i have an issue with from email.message line it pops up the error as email.message doesnot exist could you please help me

  • @Levendo
    @Levendo 29 дней назад

    Thanks! Finally, a working solution!!

  • @wmesquita7723
    @wmesquita7723 5 месяцев назад

    Hi Pycoach. I had some dificults to set the security from gmail but he process happend with sucess! Ths for the video!

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

    Thanks dude for this . Love you frank andrade.

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

    Worked without issues, thanks!

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

    Thank you ! still working as of now.

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

    how can I include text from a text file in the body message? The text file contains results of a script.

  • @ashishjstar
    @ashishjstar 2 года назад +1

    It's working dude!! Thanks a lot 😀

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

    I'm getting the following error, how do I fix it?
    TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

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

    You are the man! Thank you very much, and God bless.

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

    Great tutorial, great teaching skills, crystal clear... Thanks, mate !