Page 1 of 1
Future HTML5 and mail
Posted: Fri Aug 14, 2015 2:38 pm
by Wally
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.
Re: Future HTML5 and mail
Posted: Thu Aug 20, 2015 2:41 pm
by LCNeil
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
-
Re: Future HTML5 and mail
Posted: Mon Aug 24, 2015 12:35 am
by Wally
Thank you. I'll give it a look.
Mailgun - Livecode
Posted: Thu Feb 15, 2018 6:31 pm
by jackrarick
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
Re: Future HTML5 and mail
Posted: Tue Oct 18, 2022 7:58 pm
by joseggarza
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
Re: Future HTML5 and mail
Posted: Wed Oct 19, 2022 1:54 am
by stam
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/
Re: Future HTML5 and mail
Posted: Tue Oct 25, 2022 9:25 pm
by joseggarza
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
Re: Future HTML5 and mail
Posted: Tue Nov 01, 2022 7:00 am
by mwieder
Jose-
Please tell me that isn't your real api key.
Re: Future HTML5 and mail
Posted: Tue Nov 01, 2022 10:05 am
by FourthWorld
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.
Re: Future HTML5 and mail
Posted: Tue Nov 01, 2022 1:55 pm
by dunbarx
Aw, I missed this.
Was it racy?
Craig
Re: Future HTML5 and mail
Posted: Tue Nov 01, 2022 5:31 pm
by mwieder
Was indeed. You can get in trouble exposing some things in public.
Re: Future HTML5 and mail
Posted: Fri Nov 04, 2022 6:16 pm
by joseggarza
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