#75 Send EMAIL from your Arduino! Better HTML! Time Server! More!

preview_player
Показать описание

Last video (#74) we looked at serving up a web page from your Arduino hooked up to an Ethernet controller module or shield. We had to use some memory-saving techniques to get it all in.

This video (part 2) we look at a better way of serving up web pages from your Arduino, getting the current date & time from a Network Time Protocol (NTP) server, and finally get to send that all-important email to your mailbox using SMTP. Phew!

The HTML we use to send an email is very simple - and can now be read easily as it's formatted correctly as a text file (.htm) on the SD card. It's included in the GitHub zip file

------------------------------------------------------------------------------
There is a lot of supporting information available
------------------------------------------------------------------------------

*How to get enabled TelNet onto a Windows 10 PC*

*SMTP response codes (anything higher than 399 is an error)*

*SMTP Commands Reference*

*Sending email using SMTP*

*Arduino Playground: Time library*

-------------------------------------------------------------
Sketches & libraries used in this demo
-------------------------------------------------------------
(Just click the Clone or Download button and download a zip)
Рекомендации по теме
Комментарии
Автор

Thank you, Ralph.

Re-wireless (no wires) and ethernet (wires); I find you just can't beat a good hard wired connection!

MarkHopewell
Автор

Great tutorial for begginer! I wish you make a lot of project using Ethernet.

daesoong
Автор

You are spoiling us. TWO videos for Christmas!. You certainly packed a lot of info into this one (I don't see how you could fit it into my stocking). I had never thought of any application that would need an SD card but your using it to store HTML pages is inspired. Now, my mind is filled with myriad projects that "need" the mass storage.

I have used NTP in a couple of projects (ESP8266) but also coupled it with a DS3232. The RTC is synced every 24 hrs (at 4am to avoid clashes with DST adjustments). My time lib syncs with the RTC. Both projects also used the RTC for scheduling various events - the alarms on the D3S232 are excellent for scheduling. The 32kHz takes care of scheduling the NTP sync.

Thank you for this bumper packed Christmas video. Have a wonderful Christmas, all of you.

willofirony
Автор

Excellent tutorial, I'll be sure to have a look back through some of your other tutorials. Great work and much appreciated!!

tomasparrado
Автор

What about using MQTT, which would be really handy for monitoring temps etc. and switching on relays etc as and when required. I know you can do this wirelessly with ESP8266 and ESP32 etc, but sometimes you want to not be reliant on WiFi.
I think it can be especially good with a BluePill board for example.

stewartrv
Автор

Great video as always.
Sorry to be so dumb, but do I put my email address in place of "ralph" or "fromAddress" ?

// Tell the mail server who you are - the FROM address (must be valid email address or it will get rejected)
Serial.println(F("MAIL To: ralph"));
client.println(fromAddress);
if (!getResponse()) return 0;

Also, what do I put in place of "Arduino" or "toAddress"

// Declare you who want to send it TO
Serial.println(F("RCPT To: Arduino"));
client.println(toAddress);
if (!getResponse()) return 0;


I tried placing my emails in "fromAddress" and "toAddress" but I got this error.


Ethernet_email:60: error: stray '@' in program


Ethernet_email_test:65: error: 'david' was not declared in this scope




exit status 1
stray '@' in program


I appreciate it is mentioned in your video but I cannot get my dumb head around it :(

daviddoidge
join shbcf.ru