Hi,
I can connect to a wpa network.
I would like to be able to send a email to anybody (for example a hotmail domain... how can i do ?)
does wifi shield support dns resolution ?
Hi,
I can connect to a wpa network.
I would like to be able to send a email to anybody (for example a hotmail domain... how can i do ?)
does wifi shield support dns resolution ?
does wifi shield support dns resolution ?
The WiFi shield forms a connection between the Arduino and the LAN that the wireless router is attached to.
Once you connect to the LAN, you can do anything you want. How would you send e-mail from your laptop, which is also connected to the LAN?
Hi Paul,
Tks for your reply.
I guess i have to create
and put the packet into the socket...
Not sure...
I think the wifi shield do not have so much primitives than the ethernet shield.
I guess i have to create
- a TCP/IP packet wich encapsulate the data in the "email format" to the mail server i want to connect.
- socket
You do not need to get that 'low level' with the networking.
First try using a telnet client (on your PC) to try some of the examples given in the following links (using your target email server).
http://www.anta.net/misc/telnet-troubleshooting/smtp.shtml
http://exchange.mvps.org/smtp_frames.htm
http://support.microsoft.com/kb/153119
Once you have the hang of these examples, adapt the telnet client sketch (TelnetClient.ino) in the ethernet library examples to repeat what you have done above. (initially, you will have to use IP addresses instead or domain names unless you want to complicate things by using DNS look ups).
Then modify the sketch to do what you really want it to do.
You are only sending text strings to and fro to send a text email. If you want to send pictures/attachments, then thats another story.
Great for those info.
Yes, i'm beginning to understand the way to do it.
Tks !
The basic SMTP commands will work, as long as your email provider will accept unsecured access. Many require TLS authentication, which the Arduino can't provide.
so .. bad luck with TLS ..
Can't we add a library to do it ?
or can i use POP3 protocol ?
or... and i come back again with my low level view: create a IP packet containing all info that i need and send this packet to the distant email server.
To create de packet, i can generate it from my MAC, capture the packet with Wireshark...
still digging..;
Email is not a single packet. It is a conversation. I'm not aware of any POP or IMAP libraries.
There is smtp code around for the ethernet shield. Once the connection is established, the protocol is the same despite the transport. Here is one of mine:
And once you get to the point where it will send, it is not guaranteed the email will be accepted by the receiving email server. Many use spam blockers that will refuse email from non-commercial ip sets. If you do not have a commercial account, and you get your ip by dhcp, chances are you will be rejected.
^^^ Tim, thanks for the code. I don't need it right now but have saved it for future use. You saved me at least an hour and some head scratching.
Regards,
Jake
Instead of GMail I was forced to use SMTPcorp.com. Because my IP was blocked. And I want to send to other providers addresses.
Let me know if you want the code?
sbright33:
Instead of GMail I was forced to use SMTPcorp.com. Because my IP was blocked. And I want to send to other providers addresses.
Let me know if you want the code?
yea mate same. I've been trying for over 2 weeks now trying to connect with my arduino to gmail through telnet, however I cant get telnet to work either. May can you please send me your code. It'd be very useful.
Regards
Varun
First sign up for an account at smtpcorp.com. Then get to a Telnet SMTP prompt.
Here's the code snippet:
PRDW("ehlo");
PRDW("auth login");
PRDW("c2JyaWdodDNz"); //username google base64 encoder
PRDW("c20dkdkks"); //password
PRDW("MAIL From: <name@gmail.com>");
PRDW("RCPT To: <name@gmail.com>");
PRDW("DATA");
PRD("To: Name <name@gmail.com>");
PRD("From: Steve Bright <name@gmail.com>");
PRD("Subject: Sent by WiFly");
PRD("Text goes here");
PRD("Line2");
PRDW(".");
PRDW("QUIT");
First sign up for an account at smtpcorp.com. Then get to a Telnet SMTP prompt.
Here's the code snippet:
Doesn't anyone here wait for a response from the server? I guess it is just me...
My #define PRDW writes the response to the serial monitor for debugging. Out in the field there is nothing I can do about it if the server does not respond. I do check that I'm connected, first to the internet, then to the server. I've found my code is quite reliable in the real world around the city and woods.
Out in the field there is nothing I can do about it if the server does not respond.
My Arduino sketch in the link above works about as well "out in the field" as your terminal code does "in the lab". It is a good thing to know if the email was sent or not. You might want to have it try again or take some other action.
You have a good point. In my application it is in a loop so it tries again anyway, the next time around. It seems to work perfectly once it connects to the server, every time.