Hi I’m trying to send an email from my Hotmail account to an gmail account using my ethernet shield. It is possible? This my code: #include <SPI.h> #include <Ethernet.h>
void loop()
{
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println(“disconnecting.”);
client.stop();
for(;
;
}
}
I’m getting this in the serial monitor:
connecting
connected
220 SNT0-MC1-F36.Snt0.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft’s computer network is prohibited. Other restrictions are found a
disconnecting.
READ ONE POST UP!
I don't know if it'll work with Hotmail. I tried to do the same thing using my Gmail account, until I found out that it won't work with Gmail. I wound up using the SMTP server, and thus the email account that my ISP gives me. Works perfect every time and hasn't failed on me once since I implemented it. In fact, my first sketch didn't have anything to stop it so before I could get to the Arduino to unplug it, my iPhone had close to 30 text messages. (I have the emails sent to my phone number @ my cellular provider so they come through as SMS messages.)
That was my bad copy/paste. In the program I have
client.println ("Hello @gmail.com");
delay (x);
client.println ("Mail From:@hotmail.com>");
And get the same error :0
When you send that, my email server returns something like "400 error: I don't take email from that malformed email address". I bet theirs does too. And with my code above, that message is displayed on the serial monitor before exiting with a fail message. It will not just exit.
smtp.hotmail.con doesn't work. I use smtp.live.com and use the ip address for the server. Use bot send and receiver email from hotmail and print this:
connecting
connected
220 BLU0-SMTP410.phx.gbl Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Sat, 28 Apr 2012 11:15:42 -0700
530 5.7.0 Must issue a STAR
disconnecting.
A couple of things. You probably need a smtp account with the web based mail services, and you will probably need to provide your user ID and password in the email to use the services. Gmail may have a moble smtp service. Check with your ISP about an email account. Most in the US provide free email accounts.
Ok...the program seems to work,but I don't receive the email. I change the port 25 to port 465 for gmail to send a email to hotmail. The answer in the serial monitor is this:
It is not mine. There are no reply messages from the server.
add: And even if it was, my code has no TLS encryption to connect with port 465. But then you would have known that using my code. One of the first replies from port 465 is "OK! Start your TLS", and neither of those programs can do that.
That code won't send. Port 465 (and for Gmail it is 587) are not open connections. They both have security on them. You must authenticate with your Gmail user/password before sending anything.
Serial.println ("connecting");
if (client.connect (server,465)) {
Serial.println ("connected");
client.println ("Hello @gmail.com");
// server replies with "Hello. Start your TLS"
delay (x);
// you don't start your TLS, so the server sends "400 error - If no TLS, then no send"
// you continue to attempt the send anyway, and it keeps replying with 400 errors.