codeunitPlatform, DevOps & Performanceofficial - Microsoftderived - from the source, no model text

Codeunit 8901 "Email"

System Application · System.Email

Across versions

  1. BC23present
  2. BC241 procedures added
  3. BC2511 procedures added, 2 events added
  4. BC261 events changed
  5. BC271 procedures added
  6. BC286 procedures added
  7. BC291 events added
  8. BC30unchanged

Neighbourhood 27 connected objects and pages

Codeunit 8898 "Map Email Source" (event subscribers, 3 links)Map Email SourceCodeunit 4513 "SMTP Connector Impl." (event subscribers)Codeunit 5956 "Contact Business Relation" (event subscribers)Contact Business RelationCodeunit 6753 "Send Reminder Event Handler" (event subscribers)Send Reminder Event HandlerCodeunit 8900 "Email Impl" (calls, 31 links)Email ImplCodeunit 9520 "Mail Management" (calls, 5 links)Mail ManagementCodeunit 8361 "Financial Report Export Job" (calls, 4 links)Financial Report Export JobCodeunit 8906 "Email Editor" (calls, 4 links)Email EditorCodeunit 4582 "SOA Retrieve Emails" (calls, 3 links)SOA Retrieve EmailsCodeunit 4397 "SOA Test Setup" (calls, 2 links)Codeunit 4419 "SOA Send Reply" (calls, 2 links)SOA Send ReplyCodeunit 6940 "EA Retrieve Emails" (calls, 2 links)EA Retrieve EmailsCodeunit 8887 "Email Test Mail" (calls, 2 links)Email Test MailCodeunit 8888 "Email Dispatcher" (calls, 2 links)Codeunit 8907 "Email Viewer" (calls, 2 links)Email ViewerCodeunit 1368 "Monitored Field Notification" (calls)Monitored Field NotificationCodeunit 3309 "PA Demo Guide" (calls)PA Demo GuideCodeunit 3310 "PA Validate Setup" (calls)Codeunit 4509 "Email - Outlook API Helper" (calls)Codeunit 6938 "EA Agent Dispatcher" (calls)Codeunit 6942 "EA Mailbox Access" (calls)Codeunit 8897 "Email Error Handler" (calls)Codeunit 8902 "Email Scenario Attach Impl." (calls)Codeunit 8904 "Email Message" (calls)Page 4400 "SOA Setup" (calls)Page 4444 "Email Account Folders" (calls)Page 9033 "Invite External Accountant" (calls)

Open in the neighbourhood explorer

One hop out, from the extracted relations and call graph. Up to 40 shown; the sections below list them all.

System Application · System.Email · BC23-30 · source at ea08af5e · facts from BC29

Properties

Property Value
Access Public

Events published

  • OnShowSource(SourceTableId: Integer; SourceSystemId: Guid; var IsHandled: Boolean) (integration): Integration event to show an email source record.
  • OnBeforeFilterRemovedSourceRecords(var EmailRelatedRecord: Record "Email Related Record") + BC29 (integration): Integration event that allows applying additional filtering to related source records before they are shown.
  • OnAfterAddRelation(EmailMessageId: Guid; TableId: Integer; SystemId: Guid; var RelatedSystemIds: Dictionary of [Integer, List of [Guid]]) (integration): Integration event to add additional relations based on added relation to emails.
  • OnAfterRemoveRelation(EmailMessageId: Guid; TableId: Integer; SystemId: Guid) (integration): Integration event to execute code when relation is removed from email.
  • OnGetBodyForTestEmail(Connector: Enum "Email Connector"; AccountId: Guid; var Body: Text) (integration): Integration event to override the default email body for test messages.
  • OnFindRelatedAttachments(SourceTableId: Integer; SourceSystemID: Guid; var EmailRelatedAttachments: Record "Email Related Attachment") (integration): Integration event to get the names and IDs of attachments related to a source record.
  • OnGetAttachment(AttachmentTableID: Integer; AttachmentSystemID: Guid; MessageID: Guid) (integration): Integration event that requests an attachment to be added to an email.
  • OnEnqueuedInOutbox(MessageId: Guid) (integration): Integration event to implement additional validation after the email message has been enqueued in the email outbox.
  • OnEnqueuedReplyInOutbox(MessageId: Guid) + BC25 (integration): Integration event to implement additional validation after the email message has been enqueued in the email outbox.
  • OnAfterEmailSent(SentEmail: Record "Sent Email") (integration): Integration event that notifies senders when the email has been sent successfully. This event is isolated.
  • OnAfterEmailSendFailed(EmailOutbox: Record "Email Outbox") (integration): Integration event that notifies senders when the email has been sent unsuccessfully. This event is isolated.
  • OnBeforeOpenEmailEditor(var EmailMessage: Codeunit "Email Message"; IsNewEmail: Boolean) (integration): Integration event that allows updating of the email message before the email editor opens.
  • OnBeforeSendEmail(var EmailMessage: Codeunit "Email Message") (integration): Integration event that allows updating of the email message before the email is queued for sending.
  • OnBeforeReplyEmail(var EmailMessage: Codeunit "Email Message") + BC25 (integration): Integration event that allows updating of the email message before the email is queued for replying.
  • OnBeforeGetEmailAttachmentsByEmailScenarios(var EmailScenarioAttachments: Record "Email Scenario Attachments") Δ BC26 (integration): Integration event that allows adding filters to the Email Scenario Attachments before they are retrieved.

Procedures

  • SaveAsDraft(EmailMessage: Codeunit "Email Message"): Saves a draft email in the Outbox.
  • SaveAsDraft(EmailMessage: Codeunit "Email Message"; var EmailOutbox: Record "Email Outbox"): Saves a draft email in the Outbox.
  • SaveAsDraft(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailOutbox: Record "Email Outbox"): Saves a draft email in the Outbox.
  • Enqueue(EmailMessage: Codeunit "Email Message"): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; NotBefore: DateTime): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"; NotBefore: DateTime): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary; NotBefore: DateTime): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Enqueues an email to be sent in the background.
  • Enqueue(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; NotBefore: DateTime): Enqueues an email to be sent in the background.
  • Send(EmailMessage: Codeunit "Email Message"): Boolean: Sends the email in the current session.
  • Send(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"): Boolean: Sends the email in the current session.
  • Send(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary): Boolean: Sends the email in the current session.
  • Send(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Boolean: Sends the email in the current session.
  • Reply(EmailMessage: Codeunit "Email Message"; ExternalId: Text; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Boolean + BC25 + BC25 (obsolete 26.0: Replaced by Reply without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.): Sends a reply to an external message id in the foreground.
  • ReplyAll(EmailMessage: Codeunit "Email Message"; ExternalId: Text; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Boolean + BC25 + BC25 (obsolete 26.0: Replaced by ReplyAll without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.): Sends a reply to an external message id to all recipients on that email in the foreground.
  • EnqueueReply(EmailMessage: Codeunit "Email Message"; ExternalId: Text; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailOutbox: Record "Email Outbox") + BC25 + BC25 (obsolete 26.0: Replaced by EnqueueReply without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.): Sends a reply to an external message id in the background.
  • EnqueueReplyAll(EmailMessage: Codeunit "Email Message"; ExternalId: Text; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailOutbox: Record "Email Outbox") + BC25 + BC25 (obsolete 26.0: Replaced by EnqueueReplyAll without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.): Sends a reply to an external message id to all recipients on that email in the foreground.
  • Reply(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Boolean + BC25 + BC25: Sends a reply to an external message id in the foreground.
  • ReplyAll(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Boolean + BC25 + BC25: Sends a reply to an external message id to all recipients on that email in the foreground.
  • EnqueueReply(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailOutbox: Record "Email Outbox") + BC25 + BC25: Sends a reply to an external message id in the background.
  • EnqueueReplyAll(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailOutbox: Record "Email Outbox") + BC25 + BC25: Sends a reply to an external message id to all recipients on that email in the foreground.
  • RetrieveEmails(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailInbox: Record "Email Inbox") + BC25 + BC25 (obsolete 26.0: Replaced by RetrieveEmails with an additional Filters parameter of type Record “Email Retrieval Filters”.): Retrieves emails from the email account.
  • RetrieveEmails(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailInbox: Record "Email Inbox"; var Filters: Record "Email Retrieval Filters" temporary) + BC25 + BC25: Retrieves emails from the email account.
  • GetMailFolders(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailFolders: Record "Email Folders" temporary) + BC27
  • FindRetrievedEmail(EmailAccountId: Guid; ExternalMessageId: Text; var EmailInbox: Record "Email Inbox"): Boolean + BC28: Finds an email that was previously retrieved into the email inbox for the given account.
  • MarkAsRead(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; ExternalId: Text) + BC25: Marks the specified email as read.
  • GetEmailCategories(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; var EmailCategories: Record "Email Categories" temporary) + BC28: Gets email categories from the specified email account.
  • CreateEmailCategory(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; CategoryDisplayName: Text): Text + BC28 + BC28: Creates a new email category in the specified email account.
  • CreateEmailCategory(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; CategoryDisplayName: Text; CategoryColor: Text): Text + BC28 + BC28: Creates a new email category with a specified color in the specified email account.
  • ApplyEmailCategory(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; ExternalId: Text; CategoryDisplayName: Text) + BC28 + BC28: Applies email categories to an email message.
  • ApplyEmailCategory(EmailAccountId: Guid; EmailConnector: Enum "Email Connector"; ExternalId: Text; Categories: List of [Text]) + BC28 + BC28: Applies email categories to an email message.
  • OpenInEditor(EmailMessage: Codeunit "Email Message"): Opens an email message in “Email Editor” page.
  • OpenInEditor(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"): Opens an email message in “Email Editor” page.
  • OpenInEditor(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary): Opens an email message in “Email Editor” page.
  • OpenInEditor(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Opens an email message in “Email Editor” page.
  • OpenInEditorModally(EmailMessage: Codeunit "Email Message"): Enum "Email Action": Opens an email message in “Email Editor” page modally.
  • OpenInEditorModally(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"): Enum "Email Action": Opens an email message in “Email Editor” page modally.
  • OpenInEditorModallyWithScenario(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary; Scenario: Enum "Email Scenario"): Enum "Email Action": Opens an email message in “Email Editor” page modally with scenario.
  • OpenInEditorModally(EmailMessage: Codeunit "Email Message"; EmailAccount: Record "Email Account" temporary): Enum "Email Action": Opens an email message in “Email Editor” page modally.
  • OpenInEditorModally(EmailMessage: Codeunit "Email Message"; EmailAccountId: Guid; EmailConnector: Enum "Email Connector"): Enum "Email Action": Opens an email message in “Email Editor” page modally.
  • GetSentEmailsForRecord(TableId: Integer; SystemId: Guid; var ResultSentEmails: Record "Sent Email" temporary): Gets the sent emails related to a record.
  • GetSentEmailsForRecord(RecordVariant: Variant; var ResultSentEmails: Record "Sent Email" temporary): Gets the sent emails related to a record.
  • GetEmailOutboxForRecord(RecordVariant: Variant; var ResultEmailOutbox: Record "Email Outbox" temporary): Gets the outbox emails related to a record.
  • OpenSentEmails(TableId: Integer; SystemId: Guid) + BC24: Open the sent emails page for a source record given by its table ID and system ID.
  • OpenSentEmails(RecordVariant: Variant) + BC24: Open the sent emails page for a source record.
  • OpenSentEmails(TableId: Integer; SystemId: Guid; NewerThanDate: DateTime) + BC24: Open the sent emails page for a source record given by its table ID and system ID.
  • GetOutboxEmailRecordStatus(MessageId: Guid): Enum "Email Status": Gets the outbox email status.
  • AddRelation(EmailMessage: Codeunit "Email Message"; TableId: Integer; SystemId: Guid; RelationType: Enum "Email Relation Type"; Origin: Enum "Email Relation Origin"): Adds a relation between an email message and a record.
  • RemoveRelation(EmailMessage: Codeunit "Email Message"; TableId: Integer; SystemId: Guid): Boolean: Removes a related record from an email message.
  • HasRelations(EmailMessage: Codeunit "Email Message"): Boolean: Check if email has any related records linked.
  • AddDefaultAttachments(EmailMessage: Codeunit "Email Message"; EmailScenario: Enum "Email Scenario"): Adds the default attachments of a scenario to the email message.

Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.

Called by

Recent changes

Deprecations

  • procedure EnqueueReply: Pending 26.0 (#if not CLEAN26), “Replaced by EnqueueReply without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.”
  • procedure EnqueueReplyAll: Pending 26.0 (#if not CLEAN26), “Replaced by EnqueueReplyAll without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.”
  • procedure Reply: Pending 26.0 (#if not CLEAN26), “Replaced by Reply without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.”
  • procedure ReplyAll: Pending 26.0 (#if not CLEAN26), “Replaced by ReplyAll without the ExternalId parameter. ExternalId is not used and is contained in the EmailMessage parameter.”
  • procedure RetrieveEmails: Pending 26.0 (#if not CLEAN26), “Replaced by RetrieveEmails with an additional Filters parameter of type Record “Email Retrieval Filters”.”

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Email"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.

Evidence 1 sources