Android email doesn't work

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 324
Joined: Wed Jul 11, 2012 9:24 pm

Android email doesn't work

Post by cusingerBUSCw5N » Tue Jan 23, 2018 5:23 am

I am trying to get an email sent from an Android. The device (a tablet) is configured to send email - because it returns "true" when I use mobileCanSendMail(). In my code, it says "Email sent" - but I never receive an email. What am I missing?

tto, tsubject and tmessage are all variables pulled from fields on the card.

Code: Select all

   if the platform is "ios" then
         revMail tto,,tsubject, field tmessage
             answer "Email sent"
          else if the platform is "android" then
         mobileComposeUnicodeMail textencode("Heading","utf8"), "&tto&", "&tsubject&", , "&tmessage&"
         answer "Email sent"
      else
         answer "This feature is for mobile devices."
      end if
Thanks

Klaus
Posts: 10290
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android email doesn't work

Post by Klaus » Tue Jan 23, 2018 11:03 am

Why all the quotes and stuff? And the order of params is not correct.
...
##mobileComposeUnicodeMail textencode("Heading","utf8"), "&tto&", "&tsubject&", , "&tmessage&"

## mobileComposeUnicodeMail subject, [recipients, [ccs, [bccs, [body, [attachments]]]]]
mobileComposeUnicodeMail textencode("Heading","utf8"), tto,,,tmessage
...
Presumed -> textencode("Heading","utf8") = tSubject?

cusingerBUSCw5N
Posts: 324
Joined: Wed Jul 11, 2012 9:24 pm

Re: Android email doesn't work

Post by cusingerBUSCw5N » Tue Jan 23, 2018 4:50 pm

I'm sorry. I tried this:

mobileComposeUnicodeMail textencode("Heading","utf8"), "&tto&", "&tsubject&", , "&tmessage&"

failed (processed - never received)


mobileComposeUnicodeMail textencode(tsubject,"utf8"), [tto, [, [, [tmessage, []]]]]

failed (red - wouldn't process)

mobileComposeUnicodeMail textencode(tsubject,"utf8"), tto, , , tmessage,

failed (processed - never received)

cusingerBUSCw5N
Posts: 324
Joined: Wed Jul 11, 2012 9:24 pm

Re: Android email doesn't work

Post by cusingerBUSCw5N » Tue Jan 23, 2018 6:36 pm

I have attached an stack that doesn't work - with this code

Code: Select all

on mouseup
   put field "email" into temail
   mobileComposeMail "Help",temail,,,field "Message"
   answer "sent"
end mouseup
I am using an Samsung SM T280 tablet... and it doesn't work.

Is this a problem with my tablet? Or has Livecode changed its engine? :?
Attachments
email_issue.zip
(1.16 KiB) Downloaded 10 times

Klaus
Posts: 10290
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android email doesn't work

Post by Klaus » Tue Jan 23, 2018 7:20 pm

I don't develop for mobile, I don't even own any mobile device like cellphone or tablet or whatever!

But as I wrote earlier, you are using the wrong order of parameters, please look up the dictionary:
-> mobileComposeMail subject, [recipients, [ccs, [bccs, [body, [attachments]]]]]
The two empty parameters in my script are the lists of CC and BCC addressees.

...
## This works on iOS!
put "This is the subject" into tSubject
put "klaus@wherever.com" into tAddressee
put fld "messsage body" into tMessage
mobileComposeMail tSubject,tAddressee,,,tMessage
...

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”