Email problem with Azure Outlook

I have implemented email with FNC Cloudpack in my application. And after some initial problems with setup Azure account, secrets etc it works well.
But I have used the same test email account all the time, test.email@company.com. That is what receiver see as sender for all emails.
It looks like the authenticated accounts email is always used.

Later when use this in production I want to also set the sender email-address.
I have searched for From or Sender attribute without success.
Is it possible ?

Hi,

Please note that it is currently only possible to send emails through the email address of the authenticated account.

We'll have to investigate if the Outlook API supports sending emails where the sender email can be customized. Even if this is technically possible this will most likely be limited to shared email addresses or email addresses with sufficient permissions inside the same organization.

Thanks for the clarification.

My application is a multi-user system.
Each user has already own email account in Azure. This email is also stored in the applications database. A new instance of the application is created in memory for each logged in user. All instances is run on the same server with remote desktop.

Suppose user A is logged in and try to send an email.
At the same time user B is logged in another instance and try to send a different email. Now I try to figure out the required steps for this. Naturally both user A and B should use its own email account. I assume each account have its own combination of apikey, secret etc to be able to login.

I found this docs: Persisting Tokens - TMS FNC Cloud Pack

Is there more detailed information about each field ?

  • When User A and User B are both logged in with their own credentials, each will be sending emails from their own associated email accounts. There is no need to configure separate client IDs and secrets for each account, as these are linked to an Azure application, not an individual Azure account.
  • All fields are used to store standard authentication-related tokens and data. Please note that not all fields are required for all services. The necessary fields are automatically utilized based on the specific service being used.

Ok good that secret is connected to application not user-account!

First time user send mail login is triggered in browser.
Second time a mail is sent no login is needed.
So login need to be saved per user.

I understand that this can be done to ini-file, database or registry.
Is it possible to save many logins with ini-file or registry or should database be used in that case ?

When a new second user send mail login should be triggered.
But it will reuse the previous users account. How can I avoid that ?
Maybe I can name section in ini-file for the user.
So each user have own section ?

Another question. When login to user-account on Azure it say it last for 30 days.
Is it possible to turn it off or extend time to more days ?

If you're using a separate TTMSFNCCloudMicrosoftOutlook instance for each user, you can set a unique value in the PersistTokens.Key property for each instance. This will create a separate INI file for each user.

The lifetime of the access token is determined by the service, and we have no control over its duration. However, if a valid refresh token is available, the access token will be automatically refreshed upon expiration. You will only need to log in again if the refresh token has also expired.