Introduction: Arduino Email Sender With Ethernet Adapter/shield

Picture of Arduino Email Sender With Ethernet Adapter/shield

Hello again.

Not long ago, I reached 50 000 views on my ESP8266 Wi-fi module. I was quite amazed and wanted to thank everybody that watched it, liked it and commented on it. On September 2., I published instructable on Weather station and got featured only 15 min after publish. I was very motivated to do more as I see all the views, comments and wanted to say thank you all.

Now, let's go to the meat of this project.
My father asked me to do a little project with Arduino that would send an e-mail when a push button is pressed or anything, can be based on temperature reading, so make sure you watch my previous instructable on that or to send that something has closed up on the distance sensor. Be sure to watch those tutorials on my profile.

So I started looking on the web for a way to send emails with bare arduino and an ethernet shield. I already did a mini project that was sending email by pushing a button, but was done with some python on a pc or Raspberry pi. That can be a waste of money, if you want to leave your Raspberry or any small computer inside of a project.

So as I wanted to do it with only and ethernet shield, I came upon an obstacle. A code for this very purpose can be found in first google searches on Arduino playground site, but it gave me errors as it works with smtp protocol but most email services like gmail want a more reliable connection with some safety like SSL. Arduino just might not be able to do that. Now correct me if I'm wrong, but those were some facts that I found on forums regarding the errors that I was getting. Now what.

Than I found this amazing site called Temboo. It spins around IoT and everything related to that. They also support sending mail by their library, that is believe it or not, already implemented inside Arduino IDE by default.

I will guide how to set up a GMAIL account, how to set the electronics and get the thing working.

Step 1: PARTS THAT YOU WILL NEED

Picture of PARTS THAT YOU WILL NEED

You will need:

-Arduino Uno or any board alike

-Ethernet shield

-momentary Push button

-10k/1k Resistor (depends what you have in stock and you can use any resistor above 1k but those are most common)

-Ethernet cable

You can start by attaching the Ethernet shield on the Uno and in my case I added a prototyping shield so I don't need an external breadboard (you can see that in the introduction picture).

Step 2: Connecting Hardware

Picture of Connecting Hardware

Now that you have your Ethernet shield on your Uno, let's connect the push button to one of the free I/O pins. Keep in mind that Ethernet shield uses quite a lot of them. The ones that are free are 2, 6 and 8. I'm going to choose the pin 2.

As you can see in the picture, the push button is wired the way, that when the button is pressed, the current from 5v starts flowing threw the resistor and into GND and the PIN 2 so it puts it HIGH. But when the button isn't pressed, the resistor pulls PIN 2 LOW as it is connected to the GND so that PIN 2 doesn't read anything else when the button isn't pressed.

That's all for the hardware part of side so now let's start with setting up a GMAIL and TEMBOO account .

*If you happen to have one of those small Ethernet adapter things, I will try to show how to operate with one of those if I will find one.*

Step 3: Setting Up GMAIL Account

Picture of Setting Up GMAIL Account

Now we will configure your GMAIL account so It can be accessed by Temboo servers. For any project it is good, to make yourself another gmail account just for these kind of purpose.That way you don't need to worry about your personal account. All that said, that doesn't mean that the site will hack into it, as it can be trusted.

Now, these steps will be shown for each picture, so 1 picture 1 step, so follow the pictures while reading.

*NOTE, TE TEXT IS IN MY LANGUAGE AND I CAN'T DO ANYTHING ABOUT THAT; BUT EVERYTHING THAT YOU NEED TO CLICK WILL BE MARKED AND TOLD*

STEP 1 *has no related image*: Make yourself a gmail account to use it for sending emails.

STEP 2 *starts with first picture*: When you have logged into your new gmail account, 2-step Verification setting, that will get you the the 2-step verification setup. You can get to this setting in your gmail setting page, but it would take you some time, so go ahead and click on that link. This is going to generate a 16 character code for the Temboo to be able to access your gmail account to send emails. The page should look like this (first picture). The orange circle shows you, when your 2-step verification is active.

STEP 3: Click on the second tab on the banner that reads "Gesla za dostop...." It will say different in English but just click on the same button. It will take you on this site and now click on that bottom button that is circled with orange color.

STEP 4:Than this page should pop up that will contain all the "Apps" that have access to your gmail with each one having a unique code.

STEP 5: Click on the bottom to select the App and click "Other" and name it the way you like it.

STEP 6: This screen should pop up with a code. You want to copy that code somewhere else like an empty browser tab as you will need it later as the password. This is that 16 character code that I was talking about.

This is the end of the GMAIL part, now let's go set up your Temboo account.

Step 4: Setting Up Temboo Account

Picture of Setting Up Temboo Account

Same thing as before, every step for 1 picture.

STEP 1: Go to Temboo site and you will be prompted with this site. Enter your email and your password (not your email password, your new Temboo password).

STEP 2: Once you have done that, you will get to this site. Sellect other Arduino board +ethernet shield as this is what we have today.

STEP 3: When you get to this site...

STEP 4: ...click on the tab "Send an email from your gmail account".

STEP 5: This is the site that will open.

STEP 6: Now we will start by selecting Arduino board and Arduino ethernet on the tab nex to it. Mine is renamed, because I saved my configurations on that name, as you can do that with a click on a button on the top right corner of the form that we will fill up.

STEP 7: First thing in the form is the password, that we saved before. Put that in, everything is self explanatory.

STEP 8: Now you click the RUN button that will take your info and will put it in a code. The code can be downloaded on the bottom button. The code will look like this and doesn't need any new libraries to install. The next picture shows another arduino tab that hold your username and password and account of Temboo. In the future, you can change things like subject and body text or anything else in the code, or just simply correct the form and click again on the run button.

Step 5: COMPLEATED

Now you are all set to go and all you need is to connect your arduino sandwich to power and internet, wait a few seconds and press. You will se mail on the recipients side soon. What is all great about this is that you can add more recipients in the code and more buttons or something, so it sends mail to different people or to select a different subject or body text.

I managed to film this short demo on how does it work. Don't comment on the messy table ;)

Step 6: CONCLUSION

I would like to thank you for watching my tutorial. It took me a day to make it without any pauses with all the pictures, writing and finishing all together. I would appreciate if you recommend it if you found it useful and drop a like (favorite) or ask me anything as it keeps me motivated to do these instructables. I have lost of good ideas for the future so until than, have fun and be sure to share if you did something amazing around this project.

Cheers :)

Comments

sreddy57 (author)2015-09-05

good one ....can you provide me cost of building and for equipment..

Matej Blagšič (author)sreddy572015-09-06

I can provide you with data, that I found myself the cheapest on sites like ebay:

-Original Uno: 24$ but you can go as low as 10$ for a fake one or use something like nano or pro Micro that I bought on ebay last week for 3,5$

-ethernet shield: Original costs 30€ but I got my at our 2. hand shop for 14€ and you can probably go lower than that on ebay plus you can also get new Chinese clone for cheap

-a button and a resistor isn't more than 20 cent ;)

-if you want to know, I got my proto shield for 2$ on ebay/Bangood

Hope it helps

uno goes as low as 2.50-3 euro even. Pro mini around 1.50
have seen ethernetshield around 5 euro

protoshield, just bought one for 1.60 euro

all on Aliexpress.com,

That's even better. I literally just found out today, when my friend bought a whole uno for 3,5€ as the atmega chip costs that much here so cool, thanks for that data update :)

look here: :-)

Nice, but in the long run a little more qualified components and build can be useful to leave your project somewhere to use it as for prototyping it's probably good enough.

I have no indication that a 34 euro UNO would be better than a 2.60 euro UNO

Sercank6 (author)2017-04-17

Hi! Instead of using button, can we make auto message for example when the temperature of the home exceeds 35 degree I want to know as getting mail?

VedretH (author)2017-03-18

Hi can you send full code becouse temboo does not support other boards anymore.

adapet200 (author)2017-03-08

Hi!


I just came across your instructable and got really intrested in your work! :)

I am planing to do one of these myself, but are not sure which "Ethernet Shield" that i should pick(?)

Would this one be sufficient? --> http://www.ebay.com/itm/Mega2560-328-HOT-2560-Ardu...

(The thing i noticed with the shield in the link, is that there is no pins from the shield that goes into the Arduinos "IOREF" and "RESET".)

Whigh shield would you reccomend? :)


Thanks!
/adam

Hey,
I used just the original arduino ethernet shield that is very cheap for genuine part and got mine for 14€ locally, but now when it is officially retired, it might me cheaper. So just look for it on ebay or your local used products site. The ic on it is ws5100 to help you search.
Regards, M

DezignAndMake (author)2017-02-20

Hi All.

I am part
of the planning team that is running Tech Ilford event in Ilford Central
Library on the 17th June 2017. We are also looking for people to take part and
give talks on our March event.

We are
putting on this event to encourage people and business to use Technology like
Software / Heard wear / 3D printers / Lasers cutters / Millers / Routers /
Engravers / Knife Cutters and Embroidery / CNC Sawing and Embroidery Machines.
Anything that you use and could be shown to the public.

This would
be a great opportunity to demonstrate what your company can do to the public /
colleges and businesses.

We could
love it at Tech Ilford, if you would like to come down, take part or even give
a talk about what you do. Then please contact: janet@therestartproject.org or
Maria.Reguera@visionrcl.org.uk

Here is a
link to some of the event that we are holding;
https://www.eventbrite.co.uk/e/tech-ilford-club-tickets-30046623259?aff=erelexpmlt

With Kind
Regards

Mr Denzil
Robinson

dogla (author)2017-01-31

So how about when I want the Arduino to RECEIVE an email and give a pulse as output? Can it be done with this same setup and other code?

theyawning1z (author)2017-01-25

Where is the code?

sophk123 (author)2017-01-21

Thank you for the instructions, yet this does not work for me. I have all the parts and the same sheild, and setup, but when I press the button I dont get an email. Is their anything I should check for or do?

grendell (author)2016-05-11

Hi there,

Many thanks for your time in producing this guide. I am not clear though, will this only send a preset message? I am looking to send at least one vairable number such as " The current temp is" 123 "c" and may be date and time as well. I intend to use a RTC to send the email once a day so could add the date / time to the email.

Matej Blagšič (author)grendell2016-10-21

You can do it. Just use a variable instead of text for message to send a changing number, such as temperature.

umar_abhe (author)2016-03-02

hallo , i really appreciate your invention

whether it uses intermediaries pc to run it? or directly from arduino to switch and directly to tembo ?

Thanks

arduino connects to internet / temboo service and their site / servers do all the mail sending magic. You just need arduino and internet.

Oke, Thanks for your answer.

My apologies I haven't replied to you then, but I think if anyone has the same question, they will find it useful.

I got it hooked up to computer just for power. Only ethernet is needed.

Johnson Selva (author)2016-10-19

Hi there a got success in may first attempt of sending mail using arduino ethernet but the same code upload successfully then i received no mail for ah hour. is there any limit on temboo for mail such as 1 mail for some hour etc.,

Temboo isn't limited in any action per hour. It's juet limited in actions per month, so how many times your codes regarding Temboo servers taking action. Look it up on your dashboard on temboo.com.

Johnson Selva made it! (author)Matej Blagšič2016-10-19

it just 1 this month... see the image any idea on that by the way is it possible to exist any problem with cyber-roam in my college...

There shouldn't be any problem. It's just making a request to the server and shouldn't be blocked by your institution. I work my on school Eduroam and it altho it has many site and server request limits, it works fine. Try it out and share it with us, if you find it out

sure dude i will make sure to share my experience.... once again tanx...

RuudV3 (author)2016-02-28

where can i find the code that u used ?

Matej Blagšič (author)RuudV32016-02-28

The code is generated by the site that manages sending of the email and you download it when all data is correct and included for the code to be functional. You can find that in one of the steps.

kasimmaaz (author)2016-02-05

hello

Durring compiling show such type of error "TembooChoreo was not decleared"

ramadevigarimidi (author)2015-09-09

hloo im new to this web site can i know breifly about this pls help me out of this

What do you need help with.

Eric.Hyungki.Jung (author)2015-09-07

Hi, Nice to meet you.

My name is Eric Jung, at WIZnet in Korea.

We have been searching some application references in which WIZnet solution is applied, and found your project "Arduino Email Sender with Ethernet adapter/shield" using Ethernet Shield. In the Ethernet Shield, WIZnet’s W5100 chip is embedded. Your development looks very cool & smart.

Recently we opened WIZnet Museum (http://wiznetmuseum.com) that includes a academic-purposed collection of open projects, tutorials, articles and etc from our global customers.

As long as we have your permission, we would like to introduce your project on this website.

Please confirm with a reply.

Thanks.

I would be honored to have my Instructable included in your site. Just make sure that my name is there as I have put a lot of effort into writing and creating images and let me know the link to it as soon it is published.

Cheers,
Matej

Thanks for your kind permission.

Please visit our website,

http://wiznetmuseum.com/portfolio-items/arduino-em...

Many thanks,

Eric.

About This Instructable

44,664views

321favorites

Bio: I'm a high school student that likes electronics, Arduino projects and photography. I began working with electronics when I was 11 and got my ... More »
More by Matej Blagšič:Wi-fi weather station with BynkSimple 20 LED VU meter + datasheet guideGuide to Neopixel
Add instructable to: