{"id":129939,"date":"2023-07-12T20:54:33","date_gmt":"2023-07-12T20:54:33","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=129939"},"modified":"2025-06-25T09:31:03","modified_gmt":"2025-06-25T09:31:03","slug":"raspberry-pi-send-email-python-smtp-server","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/raspberry-pi-send-email-python-smtp-server\/","title":{"rendered":"Raspberry Pi: Send an Email using Python (SMTP Server)"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to send an email from your Raspberry Pi using a Python Script and SMTP servers. The example we&#8217;ll show can also be run on any other machine that runs Python.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi How to Send an Email using Python SMTP Server\" class=\"wp-image-129951\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclgreen\">You may also like reading: <a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-motion-email-python\/\" title=\"\">Raspberry Pi: Motion Detection with Email Notifications (Python)<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before continuing with this tutorial, check the following prerequisites.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Get familiar with the Raspberry Pi board\u2014if you&#8217;re not familiar with the Raspberry Pi, you can read our <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-raspberry-pi\/\" title=\"\"><strong>Raspberry Pi Getting Started Guide here<\/strong>.<\/a><\/li>\n\n\n\n<li>You must know how to run and create Python files on your Raspberry Pi. We like to program our Raspberry Pi via SSH using an extension on VS Code. We have a detailed tutorial about that subject: <a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-remote-ssh-vs-code\/\" title=\"\"><strong>Programming Raspberry Pi Remotely using VS Code (Remote-SSH)<\/strong><\/a>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing SMTP Servers<\/h2>\n\n\n\n<p><strong>SMTP <\/strong>means <em>Simple Mail Transfer Protocol<\/em> and it is an internet standard for email transmission. You can easily send emails using a Python Script on your Raspberry Pi using the <span class=\"rnthl rntliteral\">smtplib<\/span> library. This library defines an SMTP client session object that can be used to send mails. <a href=\"https:\/\/docs.python.org\/3\/library\/smtplib.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Learn more here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SMTP Server Settings<\/h3>\n\n\n\n<p>To send emails using a Python script on your Raspberry Pi, you need a sender email and you&#8217;ll need to know your email SMTP server settings. Below you&#8217;ll find the settings for the most popular email providers.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Gmail SMTP Server Settings<\/h4>\n\n\n\n<p>If you&#8217;re using a Gmail account, these are the SMTP Server details:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP Server: <strong>smtp.gmail.com<\/strong><\/li>\n\n\n\n<li>SMTP username: Complete Gmail address<\/li>\n\n\n\n<li>SMTP password: Your Gmail password<\/li>\n\n\n\n<li>SMTP port (TLS): <strong>587<\/strong><\/li>\n\n\n\n<li>SMTP port (SSL): <strong>465<\/strong><\/li>\n\n\n\n<li>SMTP TLS\/SSL required: <strong>yes<\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Outlook SMTP Server Settings<\/h4>\n\n\n\n<p>For Outlook accounts, these are the SMTP Server settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP Server: <strong>smtp.office365.com<\/strong><\/li>\n\n\n\n<li>SMTP Username: Complete Outlook email address<\/li>\n\n\n\n<li>SMTP Password: Your Outlook password<\/li>\n\n\n\n<li>SMTP Port: <strong>587<\/strong><\/li>\n\n\n\n<li>SMTP TLS\/SSL Required: <strong>Yes<\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Live or Hotmail SMTP Server Settings<\/h4>\n\n\n\n<p>For Live or Hotmail accounts, these are the SMTP Server settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP Server: <strong>smtp.live.com<\/strong><\/li>\n\n\n\n<li>SMTP Username: Complete Live\/Hotmail email address<\/li>\n\n\n\n<li>SMTP Password: Your Windows Live Hotmail password<\/li>\n\n\n\n<li>SMTP Port: <strong>587<\/strong><\/li>\n\n\n\n<li>SMTP TLS\/SSL Required: <strong>Yes<\/strong><\/li>\n<\/ul>\n\n\n\n<p>If you&#8217;re using another email provider, you need to search for its SMTP Server settings\u2014you&#8217;ll easily find them with a quick google search.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sender Email (New Account)<\/h2>\n\n\n\n<p>We recommend creating a new email account to send the emails to your main personal email address. <strong>Do not use your main personal email to send emails via a Python script<\/strong>. If something goes wrong in your code or if by mistake you make too many requests, you can be banned or have your account temporarily disabled.<\/p>\n\n\n\n<p>We&#8217;ll use a newly created Gmail.com account to send the emails, but you can use any other email provider. The receiver email can be your personal email without any problem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create a Sender Email Account<\/h3>\n\n\n\n<p>Create a new email account for sending emails with the ESP32\/ESP8266. If you want to use a Gmail account, <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.google.com\/gmail\/about\/\" target=\"_blank\" rel=\"noreferrer noopener\">go to this link<\/a> to create a new one.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"940\" height=\"602\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/02\/GMAIL-create-a-new-account.png?resize=940%2C602&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Gmail Create a new account\" class=\"wp-image-93593\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/02\/GMAIL-create-a-new-account.png?w=940&amp;quality=100&amp;strip=all&amp;ssl=1 940w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/02\/GMAIL-create-a-new-account.png?resize=300%2C192&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/02\/GMAIL-create-a-new-account.png?resize=768%2C492&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"create-app-password\">Create an App Password<\/h3>\n\n\n\n<p>You need to create an app password so that the RPi is able to send emails using your Gmail account. An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. <a href=\"https:\/\/support.google.com\/accounts\/answer\/185833\" target=\"_blank\" rel=\"noreferrer noopener\">Learn more about sign-in with app passwords here<\/a>.<\/p>\n\n\n\n<p>An app password can only be used with accounts that have <strong><a href=\"https:\/\/support.google.com\/accounts\/answer\/185839\">2-step verification turned on<\/a><\/strong>. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your&nbsp;<a href=\"https:\/\/myaccount.google.com\/\">Google Account<\/a>.<\/li>\n\n\n\n<li>In the navigation panel, select&nbsp;<strong>Security<\/strong>.<\/li>\n\n\n\n<li>Under \u201cSigning in to Google,\u201d select&nbsp;<strong>2-Step Verification<\/strong>&nbsp;&gt; <strong>Get started<\/strong>.<\/li>\n\n\n\n<li>Follow the on-screen steps.<\/li>\n<\/ol>\n\n\n\n<p>After enabling 2-step verification, you can create an app password.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your&nbsp;<a href=\"https:\/\/myaccount.google.com\/\">Google Account<\/a>.<\/li>\n\n\n\n<li>In the search panel, search for&nbsp;<strong>App Passwords<\/strong>.<\/li>\n\n\n\n<li>Open the&nbsp;<strong>App Passwords<\/strong>&nbsp;menu.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"491\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/app-password-menu.png?resize=750%2C491&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Google account create app password to send email with esp32\" class=\"wp-image-159018\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/app-password-menu.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/app-password-menu.png?resize=300%2C196&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<ol start=\"4\"><li>Give it a name, for example <em>Raspberry Pi.<\/em> Then, click on <strong>Create<\/strong>. <\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"531\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/07\/Creating-app-password-RPi.png?resize=590%2C531&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Google Creating an App Password for the Raspberry Pi\" class=\"wp-image-171890\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/07\/Creating-app-password-RPi.png?w=590&amp;quality=100&amp;strip=all&amp;ssl=1 590w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/07\/Creating-app-password-RPi.png?resize=300%2C270&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/figure><\/div>\n\n\n<p>It will pop-up a window with a password that you\u2019ll use with the Raspberry Pi to send emails. Save that password (even though it says you won\u2019t need to remember it) because you\u2019ll need it later.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"453\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/generated-app-password.png?resize=544%2C453&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Generated app password Google Account\" class=\"wp-image-159020\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/generated-app-password.png?w=544&amp;quality=100&amp;strip=all&amp;ssl=1 544w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/generated-app-password.png?resize=300%2C250&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><\/figure><\/div>\n\n\n<p>Now, you should have an app password that you can use on your Python script to send emails.<\/p>\n\n\n\n<p>If you&#8217;re using another email provider, check how to create an app password. You should be able to find the instructions with a quick Google search &#8220;<strong>your_email_provider<\/strong> + create app password&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Email-Sending Script<\/h2>\n\n\n\n<p>Create a new Python file called <em>send_email.py<\/em> and copy the following code.<\/p>\n\n\n\n<p>You need to insert your sender email details and the recipient email.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-python\"># Complete Project Details: https:\/\/RandomNerdTutorials.com\/raspberry-pi-send-email-python-smtp-server\/\n\nimport smtplib\nfrom email.message import EmailMessage\n\n#Set the sender email and password and recipient emai\u00e7\nfrom_email_addr =&quot;REPLACE_WITH_THE_SENDER_EMAIL&quot;\nfrom_email_pass =&quot;REPLACE_WITH_THE_SENDER_EMAIL_APP_PASSWORD&quot;\nto_email_addr =&quot;REPLACE_WITH_THE_RECIPIENT_EMAIL&quot;\n\n# Create a message object\nmsg = EmailMessage()\n\n# Set the email body\nbody =&quot;Hello from Raspberry Pi&quot;\nmsg.set_content(body)\n\n# Set sender and recipient\nmsg['From'] = from_email_addr\nmsg['To'] = to_email_addr\n\n# Set your email subject\nmsg['Subject'] = 'TEST EMAIL'\n\n# Connecting to server and sending email\n# Edit the following line with your provider's SMTP server details\nserver = smtplib.SMTP('smtp.gmail.com', 587)\n\n# Comment out the next line if your email provider doesn't use TLS\nserver.starttls()\n# Login to the SMTP server\nserver.login(from_email_addr, from_email_pass)\n\n# Send the message\nserver.send_message(msg)\n\nprint('Email sent')\n\n#Disconnect from the Server\nserver.quit()\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Raspberry-Pi\/send_email.py\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How the Code Works<\/h3>\n\n\n\n<p>Continue reading to learn how the code works and what changes you need to make to the script to make it work for you.<\/p>\n\n\n\n<p>You start by importing the libraries you need for SMTP and email-related functions: <span class=\"rnthl rntliteral\">smtplib<\/span> and the <span class=\"rnthl rntliteral\">EmailMessage<\/span> class from the <span class=\"rnthl rntliteral\">email.message<\/span> module. <\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import smtplib\nfrom email.message import EmailMessage<\/code><\/pre>\n\n\n\n<p>Next, you create variables for the email address to send from, that email\u2019s app password, and an email address to send to. We suggest you create a second email to send the notifications to your everyday email because you will be giving less secure apps access to the account you send from. <\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>#Set the sender email and password and recipient emai\u00e7\nfrom_email_addr =\"REPLACE_WITH_THE_SENDER_EMAIL\"\nfrom_email_pass =\"REPLACE_WITH_THE_SENDER_EMAIL_APP_PASSWORD\"\nto_email_addr =\"REPLACE_WITH_THE_RECIPIENT_EMAIL\"<\/code><\/pre>\n\n\n\n<p>Create an <span class=\"rnthl rntliteral\">EmailMessage()<\/span> object called <span class=\"rnthl rntliteral\">msg<\/span> that will handle the email message properties.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># Create a message object\nmsg = EmailMessage()<\/code><\/pre>\n\n\n\n<p>Set the email body on the following lines. You can change it to whatever text you want.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># Set the email body\nbody =\"Hello from Raspberry Pi\"\nmsg.set_content(body)<\/code><\/pre>\n\n\n\n<p>Then, we set the sender and recipient in the email message properties.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>msg&#091;'From'] = from_email_addr\nmsg&#091;'To'] = to_email_addr<\/code><\/pre>\n\n\n\n<p>The following line sets the email subject, you can change it to whatever you want.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>msg&#091;'Subject'] = 'TEST EMAIL'<\/code><\/pre>\n\n\n\n<p>Then, you establish communication with an SMTP server. Pass the provider\u2019s SMTP server address as a string as the first argument to <span class=\"rnthl rntliteral\">smtplib.SMTP()<\/span>, and the port as an int as the second argument.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>server = smtplib.SMTP('smtp.gmail.com', 587)<\/code><\/pre>\n\n\n\n<p>In this script, we\u2019re using a Gmail SMTP server and port. If you use another email provider, make sure to change those values.<\/p>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">server.starttls()<\/span> function is necessary for email providers that use TLS to encrypt messages (which are practically all email providers). If your email provider doesn\u2019t use TLS, you can remove or comment out that line. <\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>server.starttls()<\/code><\/pre>\n\n\n\n<p>Next, the script logs into the sending email account and sends the email.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># Send the message\nserver.send_message(msg)<\/code><\/pre>\n\n\n\n<p>Finally, we stop the communication with the server.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>server.quit()<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Demonstration<\/h2>\n\n\n\n<p>Save your Python file. Then run it on your Raspberry Pi. Run the following command on the directory of your project file (use the name of your file):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>python send_email.py<\/em><\/code><\/pre>\n\n\n\n<p>After running the script, you should receive an email from the Raspberry Pi on your email account.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"358\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Email-from-Raspberry-Pi-Received.png?resize=741%2C358&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Receive Email from Raspberry Pi\" class=\"wp-image-129948\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Email-from-Raspberry-Pi-Received.png?w=741&amp;quality=100&amp;strip=all&amp;ssl=1 741w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Email-from-Raspberry-Pi-Received.png?resize=300%2C145&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"578\" height=\"277\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/email-received-from-raspberry-pi-python-script.png?resize=578%2C277&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Email-Received-from-Raspberry-Pi\" class=\"wp-image-129947\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/email-received-from-raspberry-pi-python-script.png?w=578&amp;quality=100&amp;strip=all&amp;ssl=1 578w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/email-received-from-raspberry-pi-python-script.png?resize=300%2C144&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you learned how to send an email with the Raspberry Pi using a Python script. This example is also compatible with other boards\/machines that support Python 3.<\/p>\n\n\n\n<p>You might also like taking a look at the following tutorial that shows how to send email notifications when motion is detected:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-motion-email-python\/\">Raspberry Pi: Motion Detection with Email Notifications (Python)<\/a><\/li>\n<\/ul>\n\n\n\n<p>We have other tutorials showing how to send emails using different boards:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/micropython-send-emails-esp32-esp826\/\">MicroPython: Send Emails with the ESP32\/ESP826<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/node-red-send-email-notifications\/\">Node-RED: Send Email Notifications<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-send-email-smtp-server-arduino-ide\/\">ESP32 Send Emails using an SMTP Server<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-send-email-smtp-server-arduino\/\">ESP8266 NodeMCU Send Emails<\/a><\/li>\n<\/ul>\n\n\n\n<p>Do you want to learn more about Raspberry Pi? Take a look at our projects:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-raspberry-pi\/\">Getting Started with Raspberry Pi<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pinout-gpios\/\">Raspberry Pi Pinout Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-raspberry-pi\/\" title=\"\">All our Raspberry Pi Projects and Guides<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to send an email from your Raspberry Pi using a Python Script and SMTP servers. The example we&#8217;ll show can also be run on &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Raspberry Pi: Send an Email using Python (SMTP Server)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-send-email-python-smtp-server\/#more-129939\" aria-label=\"Read more about Raspberry Pi: Send an Email using Python (SMTP Server)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":129951,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301,264,190,268],"tags":[],"class_list":["post-129939","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-raspberrypi","category-project","category-raspberry-pi","category-raspberry-pi-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/03\/Send-Email-Raspberry-Pi-Python.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/129939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=129939"}],"version-history":[{"count":19,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/129939\/revisions"}],"predecessor-version":[{"id":171894,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/129939\/revisions\/171894"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/129951"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=129939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=129939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=129939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}