Future HTML5 and mail

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Wally
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 46
Joined: Sun Jun 15, 2008 4:51 pm
Location: Albany, NY

Future HTML5 and mail

Post by Wally » Fri Aug 14, 2015 2:38 pm

I have an education app "ready" for the new HTML5 Livecode and it needs to send Emails for user registration purposes and to send Email results of student work to their teachers. I don't want to use revmail so generally speaking I would like to get some suggestions. The stack will sit on the on-Rev server diesel.

Sendmail sounds like it has problems and I don't think Sarah's SMTP library will work. I would be willing to pay for some help, hopefully someone will create a solution for this as other LiveCode users are expressing the same need.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Future HTML5 and mail

Post by LCNeil » Thu Aug 20, 2015 2:41 pm

Hi Wally,

You might want to look into a web based email service such as mailgun

http://www.mailgun.com/

Mailgun works with a REST API. Such an API is relatively simple to hook into in LiveCode as it is just URL calls.

A great thing about mailgun is that its free for the first 10,000 emails you send so there is no cost involved when trying it out :)

Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-

Wally
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 46
Joined: Sun Jun 15, 2008 4:51 pm
Location: Albany, NY

Re: Future HTML5 and mail

Post by Wally » Mon Aug 24, 2015 12:35 am

Thank you. I'll give it a look.

jackrarick
Posts: 8
Joined: Wed Jan 21, 2015 5:17 am

Mailgun - Livecode

Post by jackrarick » Thu Feb 15, 2018 6:31 pm

Neil - and others - a little help please!

It was suggested in a post of yours (a few years ago!) that mailgun was a good alternative to sending emails. I've started working my way through their site and I certainly appreciate the suggestion.

BUT - no good deed is never gone unpunished.
AND It never hurts to ask ...

Soooo ... does anyone have a livecard stack they could share that communicates with mailgun?

I'll figure it out - I'd just love someone to save me 80 hours!

Thanks to all in advance!

Jack Rarick
Seattle WA

joseggarza
Posts: 27
Joined: Thu Jul 24, 2014 8:55 pm

Re: Future HTML5 and mail

Post by joseggarza » Tue Oct 18, 2022 7:58 pm

Hi,

did you ever receive the mailgun with livecode sample?

I am able to send email with mailgun, but I got stuck with the attachments. I am not using Curl and I don't want use it, instead I am using post from livecode.

any ideas of how to do this?

thanks in advance.

JG

stam
Posts: 1704
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Future HTML5 and mail

Post by stam » Wed Oct 19, 2022 1:54 am

joseggarza wrote:
Tue Oct 18, 2022 7:58 pm
Hi,

did you ever receive the mailgun with livecode sample?

I am able to send email with mailgun, but I got stuck with the attachments. I am not using Curl and I don't want use it, instead I am using post from livecode.

any ideas of how to do this?

thanks in advance.

JG
I'm not familiar with MailGun, but a long time back i used MailJet for things like this with both FMP and LC. I'm guessing it's pretty similar but i did find the documentation in MailJet extremely helpful. And of course use Postman to test the API calls. Sadly can't find the stack i used for testing now... but given that i did this as newbie to LC it can't be that hard ;)

MailJet has a generous free tier (6000 emails/month - 200 emails/day) with a full REST API and detailed developer documentation...
https://www.mailjet.com/
https://dev.mailjet.com/email/guides/

joseggarza
Posts: 27
Joined: Thu Jul 24, 2014 8:55 pm

Re: Future HTML5 and mail

Post by joseggarza » Tue Oct 25, 2022 9:25 pm

Thanks,

I was able to write the code myself. Here is the code I used for mailgun.com for future reference.

JG

Code: Select all

on mouseUp 
   put "https://api.mailgun.net/v3/YOURDOMAIN.com/messages" into tURL
   put base64encode("api:xxxxxxxxxxxxxx") into userpass
   put "Authorization: Basic " & userpass into UserAuth
   put empty into tFormData
   
   
   put "JOEDEO@STARFLEET.COM" into tFrom
   put "DOEJOE@ENTERPRISE.com" into tTo
   put "EMAIL TEST FROM STARFLEET TO ENTERPRISE" into tSubject
   put "THIS IS JUST A TEST EMAIL FROM MAILGUN SENDING SOME ATTACHED FILES" into tText
   
   
   put "from," & tFrom into tParameters[1]
   put "to," &tTo into tParameters[2]
   put "subject," &tSubject into tParameters[3]
   put "text," &tText into tParameters[4]
   
   
   --DEFINE ATTACHMENT FILES
   put "<file>" & "C:/test.pdf" into tFile
   put "attachment," & tFile into tParameters[5]
   put "attachment," & tFile into tParameters[6]
   
   if libUrlMultipartFormData(tFormData, tParameters) is not empty then
      answer it ##error
   else
      put line 1 of tFormData after UserAuth
      set the httpHeaders to UserAuth
      post line 2 to -1 of tFormData to url tUrl 
      ## check the result, etc., here
      set the httpHeaders to empty
   end if
   
   
end mouseUp


mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3418
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Future HTML5 and mail

Post by mwieder » Tue Nov 01, 2022 7:00 am

Jose-

Please tell me that isn't your real api key.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9442
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Future HTML5 and mail

Post by FourthWorld » Tue Nov 01, 2022 10:05 am

Thanks for catching that, Mark.

Jose, I've taken the liberty of editing you post to mask the API key.

Since it was exposed publicly here, you may want to obtain a new key.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8825
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Future HTML5 and mail

Post by dunbarx » Tue Nov 01, 2022 1:55 pm

Aw, I missed this.

Was it racy?

Craig

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3418
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Future HTML5 and mail

Post by mwieder » Tue Nov 01, 2022 5:31 pm

Was indeed. You can get in trouble exposing some things in public. :oops:

joseggarza
Posts: 27
Joined: Thu Jul 24, 2014 8:55 pm

Re: Future HTML5 and mail

Post by joseggarza » Fri Nov 04, 2022 6:16 pm

:D

No... That was just random numbers for hacker to play with .... jajajaja.

The real key is a secret....

that's way I love this community .... all members are of big help and really on top of all posts.


cheers,

JG

Post Reply

Return to “Internet”