Oh, I actually edited the code a little bit (deleting comments, nothing too vital) before submitting it. So the error is actually caught at line 18 (as shown) not 24. [import]uid: 19931 topic_id: 7443 reply_id: 26356[/import]
The Corona build process packages the required LuaSocket libraries at build time. The ones in your project folder may be conflicting with those, causing the error. Try removing all the socket libraries from your project folder and build again (you will likely need to test on a device, since I’m not sure if the simulator supports SMTP.)
Tim [import]uid: 8196 topic_id: 7443 reply_id: 26359[/import]
i’m not sure gmail works with POP3 anymore. if it does it needs https which i’m not sure is working with corona yet.
I had the same problem…
instead, set yourself up a test account on http://www.gmx.com and try your example with their smtp server (smtp.gmx.com) instead using your gmx user/pass
How were you able to work with SMTP in your app? I keep getting error messages when I try to build my project. [import]uid: 19931 topic_id: 7443 reply_id: 26364[/import]
Ok. So I was finally able to get it to build without any error messages. I had to adjust the first line to
local smtp = require ("socket.smtp")
I set up a gmx account. And adjusted the server settings in my code.
I uploaded the program onto my phone - but no email is sent. Is there something else I might be overlooking? [import]uid: 19931 topic_id: 7443 reply_id: 26795[/import]
Yay! It actually did the send. The email just took a while to go through. Thanks for your help everyone! [import]uid: 19931 topic_id: 7443 reply_id: 26801[/import]
Ah. I realized I spoke too soon. The emails that were sent were actually from running the simulator. Apparently it does support SMTP. The application on my phone will not successfully send the email. Is there something I have overlooked? Thanks! [import]uid: 19931 topic_id: 7443 reply_id: 26814[/import]
Could we please get a confirmation from Ansca whether the integrated LuaSocket library supports SSL for SMTP?
(My guess is not, as I cannot get it to connect with gmail on port 465 and there is no explicit way to specify SSL for the connection… and the official luasocket-smtp webpage (http://w3.impa.br/~diego/software/luasocket/smtp.html) doesn’t even mention ssl)
Note that if there is no SSL support… this SMTP module is pretty useless…
LuaSocket that is built into Corona does NOT support SSL. The Async APIs (network.request and network.download) support SSL but don’t support the low-level LuaSocket functionality. [import]uid: 7559 topic_id: 7443 reply_id: 63818[/import]
Thank you for the answer.
I want to give a +1 to feature: mail with attachment.
regards,
Jürgen
ps: email sending with attachments etc works ok, but without tls/ssl, so since it is a business app, this is a security issue. [import]uid: 19590 topic_id: 7443 reply_id: 63830[/import]