Skip to main content

Notifications

Announcements

No record found.

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,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 47 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,194 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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans