Arduino Uno, Gmail




Most of email library and examples for Arduino Uno on the internet

currently only support to send email via SMTP protocol. It means this library cannot send email through Gmail because Gmail uses ESMTP (Extended SMTP) protocol. In this article, I am going to show you how to send email via Gmail directly from Arduino Uno. The example is a piece of cake.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: All Things


- Arduino Uno

- PHPoC Shield for Arduino

PHPoC Shield is an internet shield (support both Wi-Fi and Ethernet). It has library to send email via Gmail and other ESMTP-based email agent as well.

All Steps

1. Stack PHPoC Shield on Arduino

2. Install Arduino library and examples for PHPoC Shield:

On Arduino IDE, Go to Sketch -> Include Library -> Manage Libraries. Type “PHPoC” on search box. Click on PHPoC row and click “Install” button.

Or you can get .zip file here:

3. Connect LAN cable (or USB Wi-Fi Dongle) to the PHPoC Shield

4. Open GmailClient example via Arduino IDE, goto File -> Examples -> Phpoc -> GmailClient.

You will see source code like below

/* arduino email client - send email via gmail relay server */

#include "SPI.h" #include "Phpoc.h"

PhpocEmail email;

void setup() { Serial.begin(9600); while(!Serial) ; Phpoc.begin(PF_LOG_SPI | PF_LOG_NET | PF_LOG_APP); //Phpoc.begin(); Serial.println("Sending email to gmail relay server");

// [login using your private password] // Google may block sign-in attempts from some apps or devices that do not use modern security standards. // Change your settings to allow less secure apps to access your account. // // [login using app password] // 1. turn on 2-step verification // 2. create app password // 3. apply app password as your login password

// setup outgoing relay server - email.setOutgoingServer("", 587); email.setOutgoingLogin("your_login_id", "your_login_password or app_password");

// setup From/To/Subject email.setFrom("from_email_address", "from_user_name"); email.setTo("to_email_address", "to_user_name"); email.setSubject("Mail from PHPoC Shield for Arduino");

// write email message email.beginMessage(); email.println("Hello, world!"); email.println("I am PHPoC Shield for Arduino"); email.println("Good bye"); email.endMessage();

// send email if(email.send() > 0) Serial.println("Email send ok"); else Serial.println("Email send failed"); }

void loop() { }

5. Put your Gmail account information (username and password), Upload code to Arduino Uno and see how it work!

Note that: Google may block sign-in attempts from some apps or devices that do not use modern security standards. Change your settings to allow less secure apps to access your account at

For more information about PHPoC Shield, visit and

If you have any questions or something to discuss, don’t hesitate to leave a comment. I am glad to discuss with you.

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    2 Discussions


    Question 1 year ago

    Hi. There are so many examples online, how to send email from Arduino. But i want to receive emails to Arduino and display them on rgb matrix. How is that possible? Thank you.

    1 answer

    Answer 1 year ago

    Hello, currently no library is available for it. You may need to implement by yourself.