Class SendTokenizedBulkEmail
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Inheritance
Namespace: DotNetNuke.Services.Mail
Assembly: DotNetNuke.dll
Syntax
public class SendTokenizedBulkEmail : IDisposable
Constructors
| Improve this Doc View SourceSendTokenizedBulkEmail()
Initializes a new instance of the SendTokenizedBulkEmail class.
Declaration
public SendTokenizedBulkEmail()
SendTokenizedBulkEmail(List<String>, List<UserInfo>, Boolean, String, String)
Initializes a new instance of the SendTokenizedBulkEmail class.
Declaration
public SendTokenizedBulkEmail(List<string> addressedRoles, List<UserInfo> addressedUsers, bool removeDuplicates, string subject, string body)
Parameters
| Type | Name | Description |
|---|---|---|
| List<System.String> | addressedRoles | |
| List<UserInfo> | addressedUsers | |
| System.Boolean | removeDuplicates | |
| System.String | subject | |
| System.String | body |
Properties
| Improve this Doc View SourceAddressMethod
Gets or sets address method for the email to be sent (TO or BCC).
Declaration
public SendTokenizedBulkEmail.AddressMethods AddressMethod { get; set; }
Property Value
| Type | Description |
|---|---|
| SendTokenizedBulkEmail.AddressMethods |
Remarks
TO is default value.
Body
Gets or sets body text of the email to be sent.
Declaration
public string Body { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
may contain HTML tags and tokens. Side effect: sets BodyFormat autmatically.
BodyFormat
Gets or sets format of body text for the email to be sent.
Declaration
public MailFormat BodyFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| MailFormat |
Remarks
by default activated, if tokens are found in Body and subject.
LanguageFilter
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Declaration
public string[] LanguageFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String[] |
PortalAlias
Gets or sets portal alias http path to be used for links to images, ...
Declaration
public string PortalAlias { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Priority
Gets or sets priority of emails to be sent.
Declaration
public MailPriority Priority { get; set; }
Property Value
| Type | Description |
|---|---|
| MailPriority |
RelayEmailAddress
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Declaration
public string RelayEmailAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RemoveDuplicates
Gets or sets a value indicating whether shall duplicate email addresses be ignored? (default value: false).
Declaration
public bool RemoveDuplicates { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Duplicate Users (e.g. from multiple role selections) will always be ignored.
ReplyTo
Gets or sets email of the user to be shown in the mail as replyTo address.
Declaration
public UserInfo ReplyTo { get; set; }
Property Value
| Type | Description |
|---|---|
| UserInfo |
Remarks
if not set explicitely, sendingUser will be used.
ReportRecipients
Gets or sets a value indicating whether shall List of recipients appended to confirmation report?.
Declaration
public bool ReportRecipients { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
enabled by default.
SendingUser
Gets or sets userInfo of the user sending the mail.
Declaration
public UserInfo SendingUser { get; set; }
Property Value
| Type | Description |
|---|---|
| UserInfo |
Remarks
if not set explicitely, currentuser will be used.
Subject
Gets or sets subject of the emails to be sent.
Declaration
public string Subject { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
may contain tokens.
SuppressTokenReplace
Gets or sets a value indicating whether shall automatic TokenReplace be prohibited?.
Declaration
public bool SuppressTokenReplace { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
default value: false.
Methods
| Improve this Doc View SourceAddAddressedRole(String)
Add all members of a role to recipient list.
Declaration
public void AddAddressedRole(string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleName | name of a role, whose members shall be added to recipients. |
Remarks
emaiol will be used for addressing, other properties might be used for TokenReplace.
AddAddressedUser(UserInfo)
Add a single recipient.
Declaration
public void AddAddressedUser(UserInfo recipient)
Parameters
| Type | Name | Description |
|---|---|---|
| UserInfo | recipient | userinfo of user to add. |
Remarks
emaiol will be used for addressing, other properties might be used for TokenReplace.
AddAttachment(Stream, ContentType)
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Declaration
public void AddAttachment(Stream contentStream, ContentType contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | contentStream | |
| ContentType | contentType |
AddAttachment(String)
Add a single attachment file to the email.
Declaration
public void AddAttachment(string localPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | localPath | path to file to attach. |
Remarks
only local stored files can be added with a path.
Dispose()
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Declaration
public void Dispose()
Dispose(Boolean)
SendTokenizedBulkEmail Class is a class to manage the sending of bulk mails that contains tokens, which might be replaced with individual user properties.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Finalize()
Finalizes an instance of the SendTokenizedBulkEmail class.
Declaration
protected void Finalize()
Recipients()
All bulk mail recipients, derived from role names and individual adressees.
Declaration
public List<UserInfo> Recipients()
Returns
| Type | Description |
|---|---|
| List<UserInfo> | List of userInfo objects, who receive the bulk mail. |
Remarks
user.Email used for sending, other properties might be used for TokenReplace.
Send()
Wrapper for Function SendMails.
Declaration
public void Send()
SendMails()
Send bulkmail to all recipients according to settings.
Declaration
public int SendMails()
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of emails sent, null.integer if not determinable. |
Remarks
Detailed status report is sent by email to sending user.
SetSMTPServer(String, String, String, String, Boolean)
Specify SMTP server to be used.
Declaration
public bool SetSMTPServer(string smtpServer, string smtpAuthentication, string smtpUsername, string smtpPassword, bool smtpEnableSSL)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | smtpServer | name of the SMTP server. |
| System.String | smtpAuthentication | authentication string (0: anonymous, 1: basic, 2: NTLM). |
| System.String | smtpUsername | username to log in SMTP server. |
| System.String | smtpPassword | password to log in SMTP server. |
| System.Boolean | smtpEnableSSL | SSL used to connect tp SMTP server. |
Returns
| Type | Description |
|---|---|
| System.Boolean | always true. |
Remarks
if not called, values will be taken from host settings.