Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Check if Default Email Account Exist

(0) ShareShare
ReportReport
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,274 Moderator 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 232 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 60,157 Super User 2025 Season 1 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans