Email Provider Helper
The EmailProvider Library provides methods for sending emails with or without attachments and using templates. It allows applications to manage email notifications, supporting attachments and customizable email templates.
Library: ADS.Email.Provider
Service: EmailProvider
Methods
1. AddAttachments (Single Attachment)
Signature: void AddAttachments(List<EmailAttachment> attachments, EmailAttachment attachment);
Description:
- Adds a single attachment to the provided list of email attachments.
Parameters:
- attachments (List) – The list of email attachments.
- attachment (EmailAttachment) – The attachment to add.
2. AddAttachments (Binary Data)
Signature: void AddAttachments(List<EmailAttachment> attachments, string Filename, string ContentType, byte[] BinaryData);
Description:
- Adds an attachment to the provided list using binary data.
Parameters:
- attachments (List) – The list of email attachments.
- Filename (string) – The name of the attachment file.
- ContentType (string) – The MIME type of the attachment.
- BinaryData (byte[]) – The binary content of the attachment.
3. Send
Signature: Task<bool> Send(string ToEmailAddress, string CCEmailAddress, string BCCEmailAddress, string Subject, string Body);
Description:
- Sends an email with the provided parameters.
Parameters:
- ToEmailAddress (string) – The recipient's email address.
- CCEmailAddress (string) – The CC recipient's email address.
- BCCEmailAddress (string) – The BCC recipient's email address.
- Subject (string) – The subject of the email.
- Body (string) – The email message body.
Returns:
- Task<bool> – Returns true if the email is successfully sent.
4. SendUsingTemplate
Signature: Task<bool> SendUsingTemplate(string ToEmailAddress, string CCEmailAddress, string BCCEmailAddress, string Subject, string template, bool isHtml);
Description:
- Sends an email using a template with the provided parameters.
Parameters:
- ToEmailAddress (string) – The recipient's email address.
- CCEmailAddress (string) – The CC recipient's email address.
- BCCEmailAddress (string) – The BCC recipient's email address.
- Subject (string) – The subject of the email.
- template (string) – The email template to be used.
- isHtml (bool) – Specifies whether the email is in HTML format.
Returns:
- Task<bool> – Returns true if the email is successfully sent.
5. SendWithAttachment
Signature: Task<bool> SendWithAttachment(string ToEmailAddress, string CCEmailAddress, string BCCEmailAddress, string Subject, string template, List<EmailAttachment> attachments, bool isHtml = false);
Description:
- Sends an email with attachments using the specified parameters.
Parameters:
- ToEmailAddress (string) – The recipient's email address.
- CCEmailAddress (string) – The CC recipient's email address.
- BCCEmailAddress (string) – The BCC recipient's email address.
- Subject (string) – The subject of the email.
- template (string) – The email template to be used.
- attachments (List) – A list of attachments to include.
- isHtml (bool, default: false) – Specifies whether the email is in HTML format.
Returns:
- Task<bool> – Returns true if the email is successfully sent.