eMail Account Selection

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trags3
Posts: 418
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

eMail Account Selection

Post by trags3 » Tue Feb 21, 2023 3:56 pm

Is it possible for someone who has multiple email accounts to select which email to use before sending an email from within a LC App?
Thanks,
Tom

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

Re: eMail Account Selection

Post by Klaus » Tue Feb 21, 2023 5:06 pm

Hi Tom,

information overload! 8)

If you are using REVMAIL for this, then the answer is NO.
The underlying OS will decide what account to use.


Best

Klaus

trags3
Posts: 418
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: eMail Account Selection

Post by trags3 » Tue Feb 21, 2023 5:13 pm

Thank You Klaus.
That was what I was afraid of.
Tom

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 262
Joined: Mon May 18, 2009 4:12 am

Re: eMail Account Selection

Post by wsamples » Wed Feb 22, 2023 4:31 pm

Is this really something to be afraid of? The user probably has chosen a default account because that's one he prefers to use. It's likely the one he would select if presented a choice in your app. In any event if someone has multiple accounts set up in his email client he can almost certainly choose from among them after the client opens. What is your aim here?

golife
Posts: 103
Joined: Fri Apr 02, 2010 12:10 pm

Re: eMail Account Selection

Post by golife » Thu Feb 23, 2023 5:55 pm

I just follow the discussion. On my Android phone I use email all the time using different accounts switching between them often. So, the use case is existing for many. Also, on desktop, I can switch without changing the setting of system defaults. I believe, there must be some possibility to switch accounts "on the fly". Not?

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

Re: eMail Account Selection

Post by Klaus » Thu Feb 23, 2023 6:30 pm

REVMAIL will "only" construct a "mailto:..." string and will pass that to the underlying OS.
So there is no way to define the account that will be used for this.

golife
Posts: 103
Joined: Fri Apr 02, 2010 12:10 pm

Re: eMail Account Selection

Post by golife » Thu Feb 23, 2023 10:15 pm

Correct, Kkaus. But that could open the question if a mechanism could be used inside LC to switch the default account and then use mailto: from with LC. So, for that time the default is changed, but closing or just leaving the app, it is set back to the original default. At least, it would be a work-around. I am not sure if that would be feasible.

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 262
Joined: Mon May 18, 2009 4:12 am

Re: eMail Account Selection

Post by wsamples » Fri Feb 24, 2023 12:19 am

golife wrote:
Thu Feb 23, 2023 10:15 pm
Correct, Kkaus. But that could open the question if a mechanism could be used inside LC to switch the default account and then use mailto: from with LC. So, for that time the default is changed, but closing or just leaving the app, it is set back to the original default. At least, it would be a work-around. I am not sure if that would be feasible.
On a desktop (I have no personal interest in or experience with email on a phone) the system setting only determines which client to open. It'll open a new message using whichever email account is set as default in the client settings. To change that you'd have to alter those client settings - hoping that the client isn't already open, or perhaps figure out how to open and maybe compose a new message from the command line for every possible client... feasibility and reliability seem very low.

Doesn't everyone who uses multiple email accounts just expect to have the client open a new message using the default address and also expect to select a different account himself if that's what he wants?

@ Tom: Is there a serious need to tie a user to a specific email address that's configured in the app that makes you want to do this? Some other requirement that makes this desirable?

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: eMail Account Selection

Post by matthiasr » Fri Feb 24, 2023 5:55 pm

On desktop maybe this could be done letting LC or the created app execute Applescript on macOS and Visualbasic script on Windows. So far so good...
But then LC or the created app needs to know which email client is the customer using and then it needs to have the correct AS/VB script for that specific mail app.
So if you can be sure that your users will definitely use Apple Mail on macOS and Outlook on Windows then it might be working.

But to be honest, i would let the user manually select the account from which the email should be sent or
you use tsNET for sending out the emails directly without any email client. tsNET is available for Windows/Mac/iOS/Android and Linux.

trags3
Posts: 418
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: eMail Account Selection

Post by trags3 » Sun Feb 26, 2023 3:46 pm

Hi All,
Thanks for the discussion.The need I have is this. I have an eMail App (in development) that will allow me to send an email to a list of recipients.
This list can be significantly larger than the 500 emails/day that Gmail allows (without Paying). I want to keep track of the number of eMails sent with the default account and then switch to another account when the limit has been reached and then continue. I can prompt the user to switch email accounts on the system when the limit has been reached but I was trying to avoid this.
Tom

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: eMail Account Selection

Post by richmond62 » Sun Feb 26, 2023 4:25 pm

Just to be a complete pain [No? Surely not?] . . .

On my main machine [Mac Mini running macOS 13] I have 2 main emails:

1. One accessed via ThunderBird (an email client).

2. Another accessed via the Brave browser.

So, I really wonder which one REVMAIL will go for.

Aha: wait a toffee-flavoured moment:
-
SShot 2023-02-26 at 17.26.07.png
-
SEEMS to indicate that, as I have to mention the email address, RevMail SHOULD send my message via that
service . . .

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: eMail Account Selection

Post by richmond62 » Sun Feb 26, 2023 4:39 pm

SShot 2023-02-26 at 17.33.10.png
-
Button "YAHOO":
-
SShot 2023-02-26 at 17.35.03.png
-
Well, I obviously missed something as what happened was that my ThunderBird app. connected to my Gmail
account opened, and bunged my message in the WRONG place:
-
SShot 2023-02-26 at 17.37.13.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: eMail Account Selection

Post by richmond62 » Sun Feb 26, 2023 4:45 pm

OK, OK: I did not read the Dictionary carefully enough:
-
SShot 2023-02-26 at 17.42.18.png
-
SShot 2023-02-26 at 17.42.44.png
-
What IS obvious, is that LiveCode [on a Mac at least] will favour an email client over a browser-based account.

Post Reply

Return to “Talking LiveCode”