and am struggling getting to this to work using Thunkable X Cross Platform and would like to know if this is the only way to send an email from ios and Android without it opening the email app.
My issue is that when I created the account in the IFTTT site it did not give me any “key” that is mentioned in this tutorial (very good guide though) and I do not see to be able to see the same blocks used here either.
Thank you for your reply. Sorry for being dumb as you probably can tell I am new to Thunkable (although I have coded in other languages) and am trying to understand your post on where the example you provided ties in with the guide from my link.
Also (I know this is IFTTT) the guide mentions about a key that IFTTT provide but when I set up this email webhook on their site, no key was provided. Have IFTTT changed this or have I set up the email webhook incorrectly ?
I am surprised however that Thunkable does not have a built in way of allowing an app to send an email without the use of 3rd party interfaces or am I missing something here? I did see a couple of plugins mentioned but I suspect that these are at a price (well the first one is anyway)?:
This also mentions another one called sendmail and the link to this site seems to mention various ways about this, is this correct? do these work with X cross platform?
Hi @giorgiospugnesi thank you for your reply . Your guide was very useful even though IFTTT have changed their systems and/or procedures.
My main goal within the app I am making is to be able to send emails without opening the mail app on the device (this app will have to work for both Android and iOS) do you know of another way around this or perhaps a plugin ?
The first thing that comes to my mind may be arranging a web host that exposes some API.
You can call that API with some parameters and let API send email. You have to protect API to avoid be called outside yor app but there are many ways to do it.
Maybe a free hosting plan could work for you.
Thanks @giorgiospugnesi for this I do have a web space hosting plan with email accounts it’s more of a share hosting would this work and what would I need to check to know it will work for this. Excuse my ignorance I’m new to thunkable
If you receive an email, all it’s ok and you can go head writing the right code.
It’s a good idea use a secret token as parameter in order to avoid sending email when someone call the page. Only call by you app should send email.
Then call that page from your Thunkable app (search documentation about how to call a web page or API) passing the right parameters.
Hi @giorgiospugnesi thank you for this yes I have written some php before on my web site hosting and run it via an URL so this sounds like it will work not sure how to apply a secret token though but again thank you
May I ask what the purpose of this is? It is generally a bad idea to send emails from an app without going through the user’s email app, as this is potentially a mechanism for phishing and other malware.
The easiest way (but less safe) is put the same “complex” string (i.e. a Guid) both in app and in PHP code. When app calls page, send that string as parameter and the page check if it’s correct.
Someone could sniff that parameters, so it’s not bulletproof but it’s a first, basic, protection.
Other solution may (and should) be implemented but just for try, go for it.
Thanks @giorgiospugnesi , I have been testing the email part first and although I got it to send two emails to start with, it appears now to have stopped working altogether. I noticed from your example that you did not state <?php then close it with the ?> so I tried that and it seemed to have worked. However since then I tried the mail command with and without using variables to hold the messages, subject etc and it has stopped sending emails and so I checked the spam engine with my web space and the spam folder of the receiving email address and I do not see any issues.
Using a database to store information for security purpose it’s a good idea. You could store phone’s IMEI or Number in order to identify sender.
I don’t know @appdevelopertcs has a DB in his hosting plan.
Hi @giorgiospugnesi when I have tried testing this further it appears that it works with my web hosting domain email address but when I send it to my gmail it appears to have worked to start with and then stopped. Would Gmail be blocking this? the first two times worked however?
@appdevelopertcs database, in your scenario, could be useful to store users authorized to send email (instead of the “secret token”).
Maybe Gmail considers your messages as span.
Maybe your host permits only “internal” email (not relay to other domains).
Try to put some code in your page that output sendig result
<?php mail("email@example.com", "Test", "Test") or die("Unable to send email") ?>
I wanted to authenticate the user trough an SMS OTP but (excluding that I can’t cause thunkable does not allow that with firebase) I had the app send secret informations as SMS sending service address and password so I thought to let a site do that, I don’t know how security works