Most email libraries and examples for Arduino Uno on the internet currently only support to send email via SMTP protocol. That 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 emails via Gmail directly from Arduino Uno. The example is a piece of cake.
If you are a beginner, you can get started with Arduino Tutorials for newbie.
Steps1. 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: https://github.com/phpoc/arduino
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.
5. Put your Gmail account information (username and password), upload code to Arduino Uno and see how it works!
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 https://www.google.com/settings/security/lesssecureapps
In order to use IPv6, just:
- Adding one more line: Phpoc.beginIP6() in source code;
- Enabling IPv6 on PHPoC Shield setting, see this: http://www.phpoc.com/support/manual/phpoc_shield_for_arduino/contents.php?id=network_ip_dhcp
- Your LAN network also has to support IPv6.
For more information about PHPoC Shield, visit http://www.phpoc.com/phpoc_shield_for_arduino.php and http://www.phpoc.com/support/manual/phpoc_shield_for_arduino
If you have any questions or something to discuss, don’t hesitate to leave a comment. I am glad to discuss with you.
Comments