Interface ISmtpConnectable
This interface provides extended methods in addition to the IConnectable interface. It supprots SMTP connections to send emails with a minimal interface.
Inherited Members
Namespace: TeleScope.Connectors.Smtp.Abstractions
Assembly: TeleScope.Connectors.Smtp.Abstractions.dll
Syntax
public interface ISmtpConnectable : IConnectable
Methods
| Improve this Doc View SourceAttach(FileInfo, String)
This method should attach a file to the latest email.
Declaration
ISmtpConnectable Attach(FileInfo file, string mimeType = null)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | The file info object that will be attached. |
System.String | mimeType | The mime type of the file. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
BlindCarbonCopy(String)
This method should add a bcc (blind carbon body) address to the last email
that was created by the last call of NewMessage
.
Declaration
ISmtpConnectable BlindCarbonCopy(string to)
Parameters
Type | Name | Description |
---|---|---|
System.String | to | The email address of the receiver. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
BlindCarbonCopy(String[])
This method should add a bcc (blind carbon body) address to the last email
that was created by the last call of NewMessage
.
Declaration
ISmtpConnectable BlindCarbonCopy(string[] to)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | to | The email addresses of the receivers. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
CarbonCopy(String)
This method should add a cc (carbon body) address to the last email
that was created by the last call of NewMessage
.
Declaration
ISmtpConnectable CarbonCopy(string to)
Parameters
Type | Name | Description |
---|---|---|
System.String | to | The email address of the receiver. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
CarbonCopy(String[])
This method should add a cc (carbon body) address to the last email
that was created by the last call of NewMessage
.
Declaration
ISmtpConnectable CarbonCopy(string[] to)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | to | The email addresses of the receivers. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
HighPriority()
This method should add a high priority flag to the latest email.
Declaration
ISmtpConnectable HighPriority()
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
LowPriority()
This method should add a low priority flag to the latest email.
Declaration
ISmtpConnectable LowPriority()
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
NewMessage(String, String)
This method should add a new message to an internal collection with only specific properties, needed to build a new email object. Sender and receivers should be known by the implementing instace beforehand.
Declaration
ISmtpConnectable NewMessage(string subject, string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | subject | The subject of the email. |
System.String | body | The message of the email. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
NewMessage(String, String, String, String)
This method should add a new message to an internal collection with the essetial properties, needed to build a new email object.
Declaration
ISmtpConnectable NewMessage(string from, string to, string subject, string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | from | The email address of the sender. |
System.String | to | The email address of the receiver. |
System.String | subject | The subject of the email. |
System.String | body | The message of the email. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
NewMessage(String, String[], String, String)
This method should add a new message to an internal collection with the essetial properties needed to build an email object.
Declaration
ISmtpConnectable NewMessage(string from, string[] to, string subject, string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | from | The email address of the sender. |
System.String[] | to | The email addresses of the receivers. |
System.String | subject | The subject of the email. |
System.String | body | The message of the email. |
Returns
Type | Description |
---|---|
ISmtpConnectable | Returns the calling instance to enable chaining method calls. |
Send()
This method should send all the created and configured emails at once and clear its inner stack.
Declaration
(int total, int success, int failed) Send()
Returns
Type | Description |
---|---|
System.ValueTuple<System.Int32, System.Int32, System.Int32> | Returns a result triple that contains the total amount of sent emails, the sucessful and the failed ones. |