[SOLVED] Sending Email - Coronium LS

I was wondering what the best way to send an email from the server would be. I tried to use the LuaSocket SMTP module, but the server doesn’t actually contain LuaSocket to my knowledge. I’m guessing that I would need some sort of network implementation or calling a Linux script or something of the sort directly. Ideally it wouldn’t be caught by spam filters, but that is likely going to come from DNS settings (which I still need to do some more research about).

What do you guys suggest?

Edit: The server does contain LuaSocket in the “luajit” folder… Just need to figure out how to require it. :stuck_out_tongue:

Double Edit: I’m not so sure why I didn’t try require(“socket.smtp”) earlier, but it works… I feel really stupid.

So are you sending email successfully?

If so, is it possible to share some code for others? Great job!

Cheers.

Well, not quite. I’m testing the email sending client side with Corona’s lua socket module. I’m trying to send it through my DNS provider. The send function is returning that it was sent successfully, but nothing is arriving in my email inbox. Once I figure this issue out, I’ll be sure to post it on the code share part of the site.

:slight_smile:

@develephant, are you including any mail server setup like postfix or dare I utter the curse word: sendmail in the deploy builds or would people need to install those features as well if they need them?

Keep in mind an unprotected SMTP handler on port 25 opens you up to be a spambot.

“I have no knowledge of sendmail.” – Me.

I’m attempting to use Mailgun to send email, as they’ve gone through the pain of DNS setup and anti-spam, etc.

I’m fairly close to getting it to work. Hopefully later today I’ll have emails working.

I successfully have emails being sent through MailGun and my module. I’m attempting to use it with my account system to send account confirmation emails, etc.

I’ll report back when I’m done with that and share it with the community.

@IKinx All I can I say is “Awesome” - you’ll also be the first module contributor. Can’t wait. I was looking at the MailGun api as well. :slight_smile:

@Rob I believe postfix is a fairly standard piece on all major Linux deployments, so the answer is “yes” - but it’s not configured to actually send mail.

When I spun up an Ubuntu 14.04 droplet to mess around on DO, postfix wasn’t installed. It was something I had to add to the server. It’s an easy install.  Though I don’t think I had my MX records setup correctly I never got in bound email to the account I setup. I didn’t test outbound mail.

Rob

@Rob Good to know! I decided to not deal with any mail via the server for various reasons. That’s why the user modules will be interesting. But I can see that someone may want to incorporate mail services on the server itself.

Cheers.

I have emails sending correctly and account confirmation working (through my users module).

My Mailgun module is relatively simple thus far, so I plan on adding the ability to send attachments as well. At the moment, I only support basic emailing.

Edit: attachments are more difficult than I thought. Perhaps I’ll try to implement them another time.

We can create a new repo on coroniumcloud as well.

Also, thanks for the issue reports on GitHub IKinx, very helpful.

No problem!

I cloned the MailGun repo. Is there a certain way you want me to do things, file wise? At the moment, my “module” is literally one lua file. The user simply creates and verifies their mailgun account, installs LuaSec through LuaRocks, and can then use the module freely.

What would you prefer I do?

you can post it here

@lKinx if you can put the Lua in a folder called “module” and if you have any CoronaSDK demos, they would go in an “examples” folder, then just push it up, you should have access. Still working out best structure. You should post to the code page too.

@scottrules44 and @IKinx I invite you join the new developer network. I’m trying to get an organized space together to chat and such.

Awesome stuff!

Cheers.

So are you sending email successfully?

If so, is it possible to share some code for others? Great job!

Cheers.

Well, not quite. I’m testing the email sending client side with Corona’s lua socket module. I’m trying to send it through my DNS provider. The send function is returning that it was sent successfully, but nothing is arriving in my email inbox. Once I figure this issue out, I’ll be sure to post it on the code share part of the site.

:slight_smile:

@develephant, are you including any mail server setup like postfix or dare I utter the curse word: sendmail in the deploy builds or would people need to install those features as well if they need them?

Keep in mind an unprotected SMTP handler on port 25 opens you up to be a spambot.

“I have no knowledge of sendmail.” – Me.

I’m attempting to use Mailgun to send email, as they’ve gone through the pain of DNS setup and anti-spam, etc.

I’m fairly close to getting it to work. Hopefully later today I’ll have emails working.

I successfully have emails being sent through MailGun and my module. I’m attempting to use it with my account system to send account confirmation emails, etc.

I’ll report back when I’m done with that and share it with the community.

@IKinx All I can I say is “Awesome” - you’ll also be the first module contributor. Can’t wait. I was looking at the MailGun api as well. :slight_smile:

@Rob I believe postfix is a fairly standard piece on all major Linux deployments, so the answer is “yes” - but it’s not configured to actually send mail.