Hi
I am using previously posted LCMail code to send an email.
Code includes
-- create the smtp message
put createSmtpMessage(tRecipient, tSender, tSubject, tMessage) into tPostData
-- send email
put tsNetSmtpSync(tURL, tSender, tRecipient, tPostData, tResponseHeaders,tBytes,tSettings) into tResult
The code which includes my username and password for my smtp account works fine when I run my app on my windows development machine but not on my android tablet (it fails to send the email and gives no warning or error message).
I want users to verify they have an NHS email account to gain access to part of my app so I am sending a code to the account they specify which they then copy and paste into an answer field for verification. Clearly I don't want the email to be displayed before it is sent hence my use of smtp. Any advice to get this to work or is there a more elegant way of validating an email address in Livecode that I can use?
Thx
Jason
Sending smtp email on android device
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 4
- Joined: Wed Dec 07, 2011 1:39 pm
Re: Sending smtp email on android device
Have you tried the new command :
?
Anyway.
With LC 9.5.1, Windows 8, stack with just :
(with Microsoft office365 as the SMTP server)
Compiled for Android. Then tested on Android 7.1 : success
BUT watchout you need to select "Internet" in the inclusions.
(i think this is strange, but anyway i've discovered that during my tests. Without this inclusion, I reveiced SSL certificate error).
Last but not least, for your app, you might use an API email system like :
http://postmarkapp.com
(transactional email)
Code: Select all
mimeEncodeAsMIMEEmail pBody,pFrom,pTo,pCc,pSubject,pAttachmentA
Anyway.
With LC 9.5.1, Windows 8, stack with just :
Code: Select all
mimeEncodeAsMIMEEmail pBody,pFrom,pTo,pCc,pSubject,pAttachmentA
put tsNetSmtpSync(tURL, tSender, tRecipient, it, tResponseHeaders, tBytes, tSettings) into tResult
Compiled for Android. Then tested on Android 7.1 : success
BUT watchout you need to select "Internet" in the inclusions.
(i think this is strange, but anyway i've discovered that during my tests. Without this inclusion, I reveiced SSL certificate error).
Last but not least, for your app, you might use an API email system like :
http://postmarkapp.com
(transactional email)
-
- Posts: 4
- Joined: Wed Dec 07, 2011 1:39 pm
Re: Sending smtp email on android device
Thanks for the reply. I hadn't selected internet on the inclusins although I did select it on the Android setup. Anyway I am up and running.