Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Check if Default Email Account Exist

Posted on by 1,159

Hi All

When trying to send an email from AL code, is it possible check if if default email account or scenario exist? The problem is unlike other table the email accounts table is not accessible due to permissions or it is displayed as a temporary table

Basically I want to set a condition like:

EmailAccount.setrange();

If emailAccount.findfirst() then

send email

Thanks

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Check if Default Email Account Exist

    hi

    in the codeunit Mail use this function

    GetDefaultScenarioEmailAddress

    DAniele

  • Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Check if Default Email Account Exist

    Hi,

    You use the procedure IsAnyAccountRegistered() in CU "Email Account" to check if an Email Account is setup (irrespective of if its SMTP or Office365).

    This is used in standard BC.  

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,127 Super User 2024 Season 2 on at
    RE: Check if Default Email Account Exist

    You can use table 8902 and codeunit 8894 "Email Account"

    Please share the error that you are getting.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans