Page 1 of 1

Android email doesn't work

Posted: Tue Jan 23, 2018 5:23 am
by cusingerBUSCw5N
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

Re: Android email doesn't work

Posted: Tue Jan 23, 2018 11:03 am
by Klaus
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?

Re: Android email doesn't work

Posted: Tue Jan 23, 2018 4:50 pm
by cusingerBUSCw5N
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)

Re: Android email doesn't work

Posted: Tue Jan 23, 2018 6:36 pm
by cusingerBUSCw5N
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? :?

Re: Android email doesn't work

Posted: Tue Jan 23, 2018 7:20 pm
by Klaus
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
...