Class SimpleMailingClient
Simple Mailing Client that has useful methods to send emails.
Inheritance
Inherited Members
Namespace: Simplic.Framework.Mailing
Assembly: Simplic.Framework.dll
Syntax
public class SimpleMailingClient
Constructors
| Improve this Doc View SourceSimpleMailingClient()
Contructor takes no parameters, creates a MailQueueManager instance
Declaration
public SimpleMailingClient()
Methods
| Improve this Doc View SourceRawSend(String, String, String, IList<String>, IDictionary<String, Byte[]>, String, String, Boolean, String)
This method saves all the parameters in the mailing queue to be sent later.
Declaration
public void RawSend(string body, string subject, string recipients, IList<string> attachmentFileNames, IDictionary<string, byte[]> attachmentBytes, string cc, string bcc, bool embedAttachment = false, string sender = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | body | |
System.String | subject | |
System.String | recipients | |
System.Collections.Generic.IList<System.String> | attachmentFileNames | |
System.Collections.Generic.IDictionary<System.String, System.Byte[]> | attachmentBytes | |
System.String | cc | |
System.String | bcc | |
System.Boolean | embedAttachment | |
System.String | sender |
Send(String, String, IDictionary<String, String>, IList<String>, IDictionary<String, Byte[]>, String, String)
This method parses an email template for "Body" and "Subject", generates a mail queueitem and puts them in the queue.
Declaration
public void Send(string emailTemplateName, string recipients, IDictionary<string, string> parameters, IList<string> attachmentFileNames, IDictionary<string, byte[]> attachmentBytes, string cc = "", string bcc = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | emailTemplateName | |
System.String | recipients | |
System.Collections.Generic.IDictionary<System.String, System.String> | parameters | |
System.Collections.Generic.IList<System.String> | attachmentFileNames | |
System.Collections.Generic.IDictionary<System.String, System.Byte[]> | attachmentBytes | |
System.String | cc | |
System.String | bcc |
SendAllMails()
This method create an email for all the entries in the SimpleMailing_MailQueue table and sends them via a configured SMTP-Server. Already sent entries (Status = 100) will not be sent again. The "DeleteSentMails" configuration variable decides if the emails are going to be deleted or marked as "Sent". All the email addresses will be validated before being sent. Not valid email addresses will be ignored.
Declaration
public void SendAllMails()
SendToGroup(String, Int64, IDictionary<String, String>, IList<String>)
This method is similar to Send(String, String, IDictionary<String, String>, IList<String>, IDictionary<String, Byte[]>, String, String) but takes a groupId as recipients.
Declaration
public void SendToGroup(string emailTemplateName, long groupId, IDictionary<string, string> parameters, IList<string> attachmentFileNames)
Parameters
Type | Name | Description |
---|---|---|
System.String | emailTemplateName | |
System.Int64 | groupId | |
System.Collections.Generic.IDictionary<System.String, System.String> | parameters | |
System.Collections.Generic.IList<System.String> | attachmentFileNames |
SendToUser(String, Int64, IDictionary<String, String>, IList<String>)
This method is similar to Send(String, String, IDictionary<String, String>, IList<String>, IDictionary<String, Byte[]>, String, String) but takes a userId as recipient.
Declaration
public void SendToUser(string emailTemplateName, long userId, IDictionary<string, string> parameters, IList<string> attachmentFileNames)
Parameters
Type | Name | Description |
---|---|---|
System.String | emailTemplateName | |
System.Int64 | userId | |
System.Collections.Generic.IDictionary<System.String, System.String> | parameters | |
System.Collections.Generic.IList<System.String> | attachmentFileNames |