Main Site Documentation

Send email with Ethernet module...possible?


#1

Is it possible to send email using the ethernet module? I’m not seeing an obvious API for it.

I’ve got the Ethernet module hooked up, and it seems to be getting an IP address OK (though I don’t seem to be getting NetworkUp/NetworkDown events firing, oddly enough), and I’ve checked out @ Architect’s RSS sample code as well.

Has anyone tried this? Just don’t want to waste my time going down a road that won’t work. I can always pop some server-side code up to handle a request if need be.

The basic scenario I’m trying to enable is to generate an image on the Spider board and email it to an email address specified by the user (BTW - the Glide library for UI stuff is awesome…love that it has a touch keyboard built into it…great stuff!).

Thanks,

Andrew


#2

Probably you can make use of older .NET Micro Framework code. Have you visited code.tinyclr.com or wiki.tinyclr.com?

http://wiki.tinyclr.com/index.php?title=FEZ_Email_based_Door_Monitor

Of course, you can take the code as a reference. it is not a plug and play thing with .NET Gadgeteer.
Probably it is a great idea if you modify the code for .NET Gadgeteer and contribute it to the community. I am sure other members will like it.


#3

Thanks, Joe!

I did some poking around on the code site, but hadn’t found any email stuff. I’ll take a look at that project, and if I get some code working for Gadgeteer, I’ll be happy to share it back with the community.

Regards,

Andrew


#4

SMTP email is fundamentally only strings of a certain format sent on port 25. The one thing that the example on the wiki somewhat glosses over is authentication; these days many servers require you to authenticate with a valid username/password combo in the SMTP stream. Good old telnet can let you test your own domain’s SMTP server, see http://technet.microsoft.com/en-us/library/bb123686.aspx


#5

This is explained in the Internet of things ebook found under this link:
http://tinyclr.com/support/


#6

@ devhammer

Ok, now I’m interested in knowing what you will be demoing :slight_smile:

Pete


#7

Pete,

That will all depend on what I can successfully develop between now and next Saturday. ;D

I was having difficulty with the networking while at the office, likely due to proxy issues, but now that I’m home, the sample RSS app is working great, so I can start playing with some TCP code to see if I can get basic SMTP functionality working.

I also found my eblock kit waiting for me when I got home, so I’ll have to find a use for that, too.


#8

Bret/Gus,

I know a fair amount about the underlying workings of SMTP, and have used telnet to test SMTP functionality in the past. What I was looking for was whether there was any higher-level APIs built into either Gadgeteer or the ethernet module that would make it easier.

Sounds like the answer to that is no, so I’ll get cracking on coding up something myself.

Thanks for the replies!


#9

Gus,

Perhaps I’m missing something, but it looks like the solution in the Internet of Things ebook relies on classes designed to work with the W5100 Ethernet TCP/IP chip. For example, the Dns class states:

“IMPORTANT: Use this class only with WIZnet W5100 Ethernet TCP/IP Chip.”

Are these classes also compatible with the Ethernet J11D Module?

In my testing, the call to Dns.GetHostEntry fails saying “DNS server IP address was not found.”

I can keep digging into this, but I want to make sure I’m not wasting my time with classes that are incompatible.


#10

“.NET” is the keyword here. Any example you see on the web for .NET C# will work as-is or with minor changes.

Yes FEZ Panda relies on Wiznet w5100 but that is not the case of large devices like FEZ Spider. But, the interface is still the same, which is .NET sockets.

Do not include any w5100 DLLs in your build and use sockets as if you were using them on a PC.


#11

Heh. That assumes that I’m used to sockets programming on a PC. Which turns out to be an erroneous assumption.

Still, I’ll figure it out eventually. :slight_smile:

In the meantime, I got my eblock expansion module working. Amazing the pleasure that comes from successfully blinking a single LED…


#12

Got it working…resolved the namespace issues by substituting the System.Net and System.Net.Sockets namespaces for the W5100 ones in the example code.

The rest was a matter of getting the syntax right, once I remembered that Verizon blocks port 25 outbound, so I needed to use port 587 instead.

I tripped myself up a couple more times with missing CRLFs, but I’ve managed to send an email once, so I’m sure I can do it again.

Once I’ve had a chance to make sure the code works consistently, and clean it up a bit, I’ll be happy to share it.


#13

Hi devhammer,
time to hammer that code onto the WIKI, budy :wink:

thank you.


#14

Will do, but wanted to get the whole solution working first…as you’ve seen on the other thread, still struggling with some aspects. :slight_smile:


#15

@ Jay

FYI, I’ve added the SMTP code to TinyCLR Code:

http://code.tinyclr.com/project/389/smtp-email-class-for-gadgeteer-based-projects/

It’s based on the FEZ email-based door monitor code found here:

http://wiki.tinyclr.com/index.php?title=FEZ_Email_based_Door_Monitor

the two big differences are that I updated the code to be compatible with the FEZ Spider ethernet module, and also added support for SMTP authentication.


#16

Thank you for sharing, the class looks great, i will try it and let you know.

LOL but i was hoping you would have tackled the SSL Authentication stuff. but it doesn’t look like you did…

basically what i’m trying to do, is make this work with GMAIL server and accounts which require the use of SSL…
i know that the Spider has SSL support but could find much doc on the subject, but i know i didn’t dig deep enough…

Gus any pointers?

thank you.
Jay.