Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Possible to Send Email W/O native.showPopup( ) ?
Started by kcdev Mar 06 2018 11:26 PM

- - - - -
4 replies to this topic
email showpopup

Best Answer Rob Miracle , 07 March 2018 - 10:59 AM

Can you vs. should you are two different questions.

 

There are two ways to do this (well probably three depending on how you look at it).

 

1. Use Lua sockets to open a port to an SMTP mail server and communicate with it using the necessary headers and data.  This would likely require a lot of work and understanding of encryption and having access to a server that's open to where anyone can do it, or you would have to let each app put in information about their SMTP server and your app would have to be smart enough to work with a variety of sending servers.  I would not go this route due to the amount of work and the level of knowledge needed to work securely with an SMTP server.

 

2. You could write a custom web script in a language like PHP that you could use network.request() to pass your data to and have the script send the email from your server. This would be much simpler than #1, but you create a huge security hole by having a script that can send arbitrary emails.  If the emails were just coming to you, say for support uses, it's a little less risky (where you are controlling the "To: " headers), but even that has security risks and you would need to be good with your web host scripting language to make sure that script is secure too.  I think this is probably a bit more realistic.

 

3. Use a well know email sending service that has a REST API.  This way, the heavy lifting on the server side is done by experts and you just have to get your network.request() working as expected. But these services are likely not free in any volume. This way will likely help you if you get black listed (a real risk with 1 & 2 above). This is basically the same as #2, but you're using someone else's mail server.

 

There is a 4th option that I probably should mention. Chris Beyerly (@develephant) has a plugin in our marketplace that works with the Mail Gun service. See: https://marketplace.coronalabs.com/plugin/mailgun-sender

 

Chris also has an online service, tied in with a Corona plugin called Coronium Core. This involves you setting up a server on a couple of different platforms but you get to do all your development in Lua which is pretty cool. You still have to have some server skills to setup and maintain the server side of this.

 

Rob

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

kcdev

[GLOBAL: userInfoPane.html]
kcdev
  • Contributor

  • 115 posts
  • Corona SDK

Is this possible?

 

Worst case scenario, I can use native.showPopup( ), but I would like to avoid this if possible, as popups feel "cheap", I don't want my app to look or feel cheap.

 

Ideally, there will be multiple text boxes/fields the user can fill in (each corresponding to email title and body, etc.) and a "send" button the user can tap when s/he is done.

 

Is something like this possible?

 

KC



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,935 posts
  • Enterprise

  Best Answer

Can you vs. should you are two different questions.

 

There are two ways to do this (well probably three depending on how you look at it).

 

1. Use Lua sockets to open a port to an SMTP mail server and communicate with it using the necessary headers and data.  This would likely require a lot of work and understanding of encryption and having access to a server that's open to where anyone can do it, or you would have to let each app put in information about their SMTP server and your app would have to be smart enough to work with a variety of sending servers.  I would not go this route due to the amount of work and the level of knowledge needed to work securely with an SMTP server.

 

2. You could write a custom web script in a language like PHP that you could use network.request() to pass your data to and have the script send the email from your server. This would be much simpler than #1, but you create a huge security hole by having a script that can send arbitrary emails.  If the emails were just coming to you, say for support uses, it's a little less risky (where you are controlling the "To: " headers), but even that has security risks and you would need to be good with your web host scripting language to make sure that script is secure too.  I think this is probably a bit more realistic.

 

3. Use a well know email sending service that has a REST API.  This way, the heavy lifting on the server side is done by experts and you just have to get your network.request() working as expected. But these services are likely not free in any volume. This way will likely help you if you get black listed (a real risk with 1 & 2 above). This is basically the same as #2, but you're using someone else's mail server.

 

There is a 4th option that I probably should mention. Chris Beyerly (@develephant) has a plugin in our marketplace that works with the Mail Gun service. See: https://marketplace.coronalabs.com/plugin/mailgun-sender

 

Chris also has an online service, tied in with a Corona plugin called Coronium Core. This involves you setting up a server on a couple of different platforms but you get to do all your development in Lua which is pretty cool. You still have to have some server skills to setup and maintain the server side of this.

 

Rob



[TOPIC: post.html]
#3

kcdev

[GLOBAL: userInfoPane.html]
kcdev
  • Contributor

  • 115 posts
  • Corona SDK

Thank you Rob for your detailed answer!

 

Unfortunately, I don't have any knowledge of web-based languages so this is way out of my league.

 

Even if I could somehow miraculously get this to work (which is unlikely since I am a newbie in this area), it seems like an awful lot of additional work put in, judging from your response.

 

Although I am not too happy about it, I think I will just stick to native.showPopup( ) for now. I just don't have the time nor the knowledge to write server-related code.

KC



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

@kc - Is there a reason the mailgun solution is no good for you?  If you haven't, you should check it out: https://marketplace.coronalabs.com/plugin/mailgun-sender



[TOPIC: post.html]
#5

kcdev

[GLOBAL: userInfoPane.html]
kcdev
  • Contributor

  • 115 posts
  • Corona SDK

@RG

Yes, the mailgun plugin could work. The thing is my philosophy is that I want to keep everything free during development. One of the reason I chose Corona in the first place was that it was free to use, and this goes against that.

 

However, I may buy it in the future depending on client response. We'll see.




[topic_controls]
[/topic_controls]