{"id":2218,"date":"2019-07-06T06:28:08","date_gmt":"2019-07-06T04:28:08","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=2218"},"modified":"2019-07-06T07:49:25","modified_gmt":"2019-07-06T05:49:25","slug":"send-email-with-python","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/send-email-with-python\/","title":{"rendered":"Send email with Python"},"content":{"rendered":"<p>With gmail and Python you can send emails without having to go into gmail, but just with some Python&#8217;s code. Let&#8217;s see how.<\/p>\n<p><iframe loading=\"lazy\" title=\"Python to send an email with gmail\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/yDxNikLwDb4?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>You will need to generate the password like showed in the video<\/p>\n<pre class=\"lang:default decode:true \">import smtplib\r\n\r\nserver = smtplib.SMTP(\"smtp.gmail.com\", 587)\r\nserver.ehlo()\r\nserver.starttls()\r\nserver.ehlo()\r\nserver.login(\"myemai@gmail.com\",\"fhgdsfkhsdkfhsdkj\") # substitute password\r\nserver.sendmail(\"myemail.gio@gmail.com\", # change user account\r\n\t\"otheremail.gio@gmail.com\", # change destination email\r\n\t\"This is the message into the email\") # change the message\r\n\r\nserver.quit()<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"Send email with Python\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/send-email-with-python\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":2224,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[429],"tags":[],"class_list":["post-2218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=2218"}],"version-history":[{"count":1,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2218\/revisions"}],"predecessor-version":[{"id":2219,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2218\/revisions\/2219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/2224"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=2218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=2218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=2218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}