web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Send Email using Offic...
Power Apps
Answered

Send Email using Office365Outlook.SendEmailV2 using offline mode

(0) ShareShare
ReportReport
Posted on by 22

Hi,

I am working on an offline app that contains in some pages email send 

is it possible to send email while offline ( save it offline) and send it back once connected automatically

i mean like savedata() and loaddata()

 

Thank you 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @charbelarmaleh :

    Do you wish to achieve the following functions:

    • When the app is offline, save the email content locally.
    • When the user connects to the Internet and opens the app again, the app automatically sends out the mail saved locally.

    As you might expect, using savedata() and loaddata() can easily achieve this function.I've made a test for your reference:

    1\Add a button:

    Text

     

    If(
     Connection.Connected,
     "Send an Email",
     "Send an Email(OffLine Mode)"
    )/*When the app is in offline mode, it displays "Send an Email(OffLine Mode)"*/

     

    OnSelect

     

    If(
     Connection.Connected,
     Office365Outlook.SendEmailV2(
     "bof@xx.com",
     "Subject",
     "Body"
     ),/*When the device is online, send email directly*/
     Collect(
     EmailWaitingToBeSent,
     {
     To: "bof@xx.com",
     Subject: "Subject",
     Body: "Body"
     }
     );/*When the app is in offline mode, the content of the mail to be sent is stored in a collection named EmailWaitingToBeSent*/
     SaveData(
     EmailWaitingToBeSent,
     "Emails"
     )/*Save the collection EmailWaitingToBeSent to the local*/
    )

     

    2\Set the app's OnStart proeprty to :

     

    LoadData(
     EmailWaitingToBeSent,
     "Emails"
    );
    If(
     Connection.Connected && CountRows(EmailWaitingToBeSent) > 0, /*When the device is online and there are records in EmailWaitingToBeSent, send an email and clear the collection EmailWaitingToBeSent*/
     ForAll(
     EmailWaitingToBeSent,
     Office365Outlook.SendEmailV2(
     To,
     Subject,
     Body
     )
     );
     Clear(EmailWaitingToBeSent);
     SaveData(
     EmailWaitingToBeSent,
     "Emails"
    )
    )

     

    Note: Emails saved locally can only be sent automatically when the device is online and the app is reopened.

    -------------------------------------------Optional step-----------------------------------------------------

    If you want to check the connection status of the device in real time, send the mail stored locally in real time. Then you need to use a timer control.

    Add a timer control:

    AutoStart

     

    true

     

    Duration

     

    1000/*loop in 1s*/

     

    OnTimerEnd

     

    If(
     Connection.Connected && CountRows(EmailWaitingToBeSent) > 0,
     ForAll(
     EmailWaitingToBeSent,
     Office365Outlook.SendEmailV2(
     To,
     Subject,
     Body
     )
     );
     Clear(EmailWaitingToBeSent);SaveData(
     EmailWaitingToBeSent,
     "Emails"
    ))

     

    Repeat

     

    true

     

    Visible

     

    false

     

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard