Hi all!
I would like to create “Reset Password with email in background” function in my App.I would like to know how to send an email in background without using “native.showPopup(“mail”, options)”.
Thanks you so much…
Hi all!
I would like to create “Reset Password with email in background” function in my App.I would like to know how to send an email in background without using “native.showPopup(“mail”, options)”.
Thanks you so much…
Sending email is tricky. If you want to do it yourself from your app, you will have to have a mail server that you can open a socket connection to port 25 for un-encrytped sends and most likely provide some form of username/password since open SMTP ports are frequently used for spam or evil purposes. Most servers are requiring people to use some form of SSL to a different port to encrypt the sending of the email.
What is probably an easier solution is to setup a web form with PHP or similar that will have a server send the email using their sendmail facilities. You do a network.request() to the script that triggers sending the email. You can pass parameters in to customize the output. That way you don’t need to deal with all the socket communications needed to roll your own.
I’m not entirely sure it will work with Lua but you may want to look into Amazon Simple Email Service. http://aws.amazon.com/ses/
Using that you could possibly be able to send emails from app using them as server. There is a setup process but at least you don’t have to worry about maintaining an email server.
I am doing it using postmarkapp.com. Sending a plain email is easy enough from the backend. It’s adding an attachment that’s hard! I need to send music recordings (thus .aif) files over from a music student to his/her teacher after a practice session is completed. I just can’t seem to get an attachment configured properly. I’ve tried posting to Parse.com and embedding a link into an email (the .aif gets mangled), sending a straight up attachment via Postmark (it has to be done in base64, no use to me if a teacher can’t open the attachment) and smtp which isn’t straightforward at all. I used the new zip plugin to successfully zipped the recording…but sending it in a non-mangled format is really hard.
Rob, what’s the best way to send attachments _not_ in base64?
thanks,
Jen
So, just to be clear, it’s impossible to just send the email using the default mail application without showing the popup or having to hit the send button from within the mail application itself? I’d just like to bypass the pick-your-email-app and the hit-the-send-button steps. They are useless to me because I don’t want to edit the email before sending.
You can absolutely use the REST API using PostMarkApp.com to send a basic email behind the scenes. My use case is that a parent is emailed when a child completes a lesson. I have a settings screen where the parent inputs the email to which mails are sent, and a switch widget where s/he enables that utility. Then once a practice session is completed, I fire a network request call via the REST API and PostMarkApp sends an email with a message that I have pre-set (“Your student completed a lesson, hooray”). My problem is getting a large attachment to be sent, and I’m getting a workaround configured for that asap.
For the attachment, I have to use the native popup functionality. If you aren’t worried about attachments, you can totally use the network.request utility built-in to CoronaSDK. It works nicely.
Sending email is tricky. If you want to do it yourself from your app, you will have to have a mail server that you can open a socket connection to port 25 for un-encrytped sends and most likely provide some form of username/password since open SMTP ports are frequently used for spam or evil purposes. Most servers are requiring people to use some form of SSL to a different port to encrypt the sending of the email.
What is probably an easier solution is to setup a web form with PHP or similar that will have a server send the email using their sendmail facilities. You do a network.request() to the script that triggers sending the email. You can pass parameters in to customize the output. That way you don’t need to deal with all the socket communications needed to roll your own.
I’m not entirely sure it will work with Lua but you may want to look into Amazon Simple Email Service. http://aws.amazon.com/ses/
Using that you could possibly be able to send emails from app using them as server. There is a setup process but at least you don’t have to worry about maintaining an email server.
I am doing it using postmarkapp.com. Sending a plain email is easy enough from the backend. It’s adding an attachment that’s hard! I need to send music recordings (thus .aif) files over from a music student to his/her teacher after a practice session is completed. I just can’t seem to get an attachment configured properly. I’ve tried posting to Parse.com and embedding a link into an email (the .aif gets mangled), sending a straight up attachment via Postmark (it has to be done in base64, no use to me if a teacher can’t open the attachment) and smtp which isn’t straightforward at all. I used the new zip plugin to successfully zipped the recording…but sending it in a non-mangled format is really hard.
Rob, what’s the best way to send attachments _not_ in base64?
thanks,
Jen
So, just to be clear, it’s impossible to just send the email using the default mail application without showing the popup or having to hit the send button from within the mail application itself? I’d just like to bypass the pick-your-email-app and the hit-the-send-button steps. They are useless to me because I don’t want to edit the email before sending.
You can absolutely use the REST API using PostMarkApp.com to send a basic email behind the scenes. My use case is that a parent is emailed when a child completes a lesson. I have a settings screen where the parent inputs the email to which mails are sent, and a switch widget where s/he enables that utility. Then once a practice session is completed, I fire a network request call via the REST API and PostMarkApp sends an email with a message that I have pre-set (“Your student completed a lesson, hooray”). My problem is getting a large attachment to be sent, and I’m getting a workaround configured for that asap.
For the attachment, I have to use the native popup functionality. If you aren’t worried about attachments, you can totally use the network.request utility built-in to CoronaSDK. It works nicely.