hey all i know this has been talked about 1000 times, i have found 1000 posts.... and i am darn close to makeing this work.
Hardware: Arduino uno back-packed with a wifly shield.
The following is the code that i am using, i am connecting to Comcast to send and email to myself. I know how to make it work in telnet and i have been able to manually complete the email on the uno, but now i am switching over to using a command to send the full email. The problem is occurring when i send the helo to Comcast, i am getting back an error 500 command unrecognized.
the basic code should work as if so:
i input the word "send" into serial log process begins
i first issue exit to make sure i am out of command mode on wifly board
second i enter command mode
i open connection to Comcast
i send helo
i close connection
after i close i reset my sting to blank.
right now i have the open and close working just fine its just the helo i am struggling with, where am i going wrong? I am leaning towards something in the formatting, helo is long multiple chars could be possible causing the problem where as quit is short? any ideas?
Power on testsend
Attepting to concect
CMD
opening port
open smtp.comcast.net 587
ok soo i got it working sort of by changeing my code to the following, can someone explain why its working but i am still getting an error? something must be getting left over from my open command but i am not sure what.
Even if you get past that, chances are Comcast will not let you send email on port 587 without TLS, and no Arduino library I am aware of supports TLS encryption. The Comcast server should send a "STARTTLS" message next, and you can't do that.
To login to the server is actualy quite easy below is the sequence i am using over telnet. unless there is something i am missing, would telnet support tls without having to do any thing special? i send each string in succession and it works great over telnet, the farthest i went with the arduino manually was to send the helo and then authenticate both manually were successful, though i never actually sent an email over the arduino but i have several times over telnet. i just got to that point and figured it would work. now you have me thinking.
telnet smtp.comcast.net 587
helo smtp.comcast.net
AUTH Login
Login 64 bit encrypted
Password 64bit encrypted
mail from:<blank@comcast.net>
RCPT To:<blank@comcast.net>
DATA
Subject: test message sent from arduino
Hello World,
This is a test message sent from a manual telnet session.
Yours truly,
SMTP administrator
.
quit
220 omta24.emeryville.ca.mail.comcast.net comcast ESMTP server ready
I use this with my email code.
// change 1.2.3.4 to your public ip
client.println(F("helo 1.2.3.4"));
You can see my ethernet code here: http://playground.arduino.cc/Code/Email
It doesn't use any authentication because it sends email like one email server sends to another email server, but it may help you with the protocol.
SurferTim you had me scared but it seems all is working fine for now.... if only i could figure out what was causing that 500 error. I know i read something that if you are on one of the ISP's IP addresses that they are more open to communicaion. So now time to build a bit more code and clean up what i have. Then take it on the road for testing.
Power on testsend
CMD
open smtp.comcast.net 587
Connect to 76.96.40.155:587
<4.41> OPEN220 omta01.emeryville.ca.mail.comcast.net comcast ESMTP server ready
500 5.5.1 command unrecognized
250 omta01.emeryville.ca.mail.comcast.net hello [BLANK], pleased to meet you
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6
235 2.7.0 ... Authentication succeeded
250 2.1.0 BLANK@comcast.net sender ok
250 2.1.5 BLANK@comcast.net recipient ok
354 enter mail, end with "." on a line by itself
250 2.0.0 mail accepted for delivery
221 2.0.0 omta01.emeryville.ca.mail.comcast.net comcast closing connection CLOS
I was shocked too but seems to be working. If i drop that line it it messes everything else up, at this point it must be some junk data the board is spitting out and by keeping that line i am in short clearing it and starting fresh.... i guess for now its working the way i want it to, i just hate having the error code pop up but why fret if it is working right?
So this has been very helpful but Im having one issue and maybe some one can help me under stand before I go any further?
To verify all my cmds and logins were good I opened up a telnet session in windows and followed Tallguys cmd lines and it looks as if I sent an email... however I dont see it come thru in my gmail account???? but it said "accepted for delivery" so whats up? blocked?
thanks in advance.
telnet smtp.comcast.net 587 220 resomta-po-07v.sys.comcast.net comcast ESMTP server ready helo smtp.comcast.net 250 resomta-po-07v.sys.comcast.net hello [11.111.111.111], pleased to meet you AUTH Login 334 VXNlcm5hbWU6 (user64b) 334 UGFzc3dvcmQ6 (pw64b)
To: first fmlast@gmail.net From: first fmlast@comcast.net Subject: Arduino email test\r\n This is from my Arduino! . 250 2.0.0 xeMR1o00l2Grcle01eN0RE mail accepted for delivery quit 221 2.0.0 resomta-po-07v.sys.comcast.net comcast closing connection
looks like the emails were accepted but bounced by Comcast since I revived two "Delivery status notification" about 10mins later: "Delivery to the following recipients was aborted after 0 second(s):" fmlast@gmail.com
So i tried changing the To: and From: both to the fmlast@comcast.net adders and bingo! email sent instantly... however it looks totally like SPAM. Its says its from "Unknown" and (NOT GOOD)
So i think i messed up the cmd line order? or missed one? mail from... RCPT To... DATA... To: ... From: ... Subject ... .
my email subject is blank and the body looks like this: From: NAME fmlast@comcast.net Subject: Arduino email test\r\n This is from my Arduino!
I have email code for the Arduino, but is designed for port 25. It has all but the AUTH part in the correct order from what I have tested. Maybe it will give you an idea about the send that you are missing or out of order. http://playground.arduino.cc/Code/Email
ok cool, yup that's the code/thread that got me here. Nice work.
I figured out what was going on. Its kinda weird and was due to or spacing but probably bc im on a cmd line telnet . Here is the solution in red
....after the DATA cmd, press enter.
To: NAME fmlast@comcast.net (press enter)
From: NAME fmlast@comcast.net (press enter)
Subject: Arduino email test (press enter TWO TIMES)
now type email body (press enter TWO TIMES)
. (press enter)
then you get a proper email to your gmail account!!!!
thanks for all your help, now its onto making the sketch knowing the smtp is good.