As the title says... Chat on...

User avatar
By swilson
#11549 OK, got it talking to gmail but got this error after it connected.

451 4.5.0 SMTP protocol violation, see RFC 2821 g51sm8258981qgg.23 - gsmtp

any ideas?

Code: Select all>
conn=net.createConnection(net.TCP, 1)
conn:on("receive", function(conn, payload)
       print(payload)
       end)
   
conn:on("connection", function(conn,payload)
print("sending...")
conn:send("EHLO\r\n");
conn:send("AUTH LOGIN\r\n");
conn:send("username\r\n");--username
conn:send("password\r\n"); --password
conn:send("MAIL FROM:xxx@gmail.com\r\n");
conn:send("RCPT TO:xxx@gmail.com\r\n");
conn:send("DATA\r\n");
conn:send("Subject:%s\r\n%s\r\n.",subject,body);
conn:send("quit\r\n");
   
end)

conn:connect(465,"smtp.gmail.com")
User avatar
By dadangluki
#11713 You can try http://www.gmx.com/. I also have same problem sending email with gmail and ymail. I have not tested it with nodemcu but with putty and my wiznet Wiz200 web server. You can make email account in gmx.com. With that acount you can send email to other mail server like gmail and ymail.

TCP
ip: 212.227.17.184
port: 587


Just try it.
User avatar
By picstart
#12488 Well,
The smtp-email.lua in the nodemcu examples is nice as far as a template goes.

The issue with lua is it is often very close to the cliff edge where almost any additional code sends the code space over the cliff.

Now if this code is compiled and the esp8266 reset to get some heap space back it actually does run but lua probably needs to be reset before running twice.

The application is limited

I believe the code only works for some e-mail servers.
If the server is using STARTTLS I don't think it will work for the following.
Users of STARTTLS are
Amazon.com
Comcast.net
Dropbox.com
Facebook.com
Google.com (Gmail)
Microsoft.com (Outlook)
Sonic.net]
Spideroak.com
Yahoo.com
Centurylink.com
User avatar
By AndyReischle
#45674 The smtp example script from the NodeMCU GitHub repository only needed a few tiny modifications to work with gmail. Code here: http://www.areresearch.net/2016/04/how-to-send-emails-via-gmail-from.html

No support for attachments, though.

rgds
Andy