Imap.StoreMessageAsync Method
Namespace: Rebex.Net
Assembly: Rebex.Imap.dll (version 7.0.9119)
StoreMessageAsync(String, MimeMessage, ImapMessageFlags, String[], Object)
Begins asynchronous StoreMessage operation. Uploads the message to the specified folder and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, MimeMessage message, ImapMessageFlags flags, string[] keywords, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
MimeMessage | message | Message to upload. |
ImapMessageFlags | flags | Message flags. |
String[] | keywords | Keywords to set. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
Remarks
This method represents IMAP APPEND command.
Unique ID of the message will be returned if the server supports the ImapExtensions.UniqueIdPlus extension and it is enabled. See SupportedExtensions and EnabledExtensions.
StoreMessageAsync(String, MailMessage, ImapMessageFlags, String[], Object)
Begins asynchronous StoreMessage operation. Uploads the message to the specified folder and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, MailMessage message, ImapMessageFlags flags, string[] keywords, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
MailMessage | message | Message to upload. |
ImapMessageFlags | flags | Message flags. |
String[] | keywords | Keywords to set. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
StoreMessageAsync(String, String, String, String, String, ImapMessageFlags, String[], Object)
Begins asynchronous StoreMessage operation. Uploads the message to the specified folder and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, string from, string to, string subject, string body, ImapMessageFlags flags, string[] keywords, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
String | from | Message sender. |
String | to | Comma-separated list of message recipients. |
String | subject | The subject of the message. |
String | body | The text body of the message. |
ImapMessageFlags | flags | Message flags. |
String[] | keywords | Keywords to set. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
StoreMessageAsync(String, Stream, ImapMessageFlags, String[], Object)
Begins asynchronous StoreMessage operation. Uploads the message read from the stream to the specified folder and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, Stream input, ImapMessageFlags flags, string[] keywords, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
Stream | input | The input stream. |
ImapMessageFlags | flags | Message flags. |
String[] | keywords | Keywords to set. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
Remarks
The stream must contain data in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be uploaded using this method.
This method represents IMAP APPEND command.
Unique ID of the message will be returned if the server supports the ImapExtensions.UniqueIdPlus extension and it is enabled. See SupportedExtensions and EnabledExtensions.
StoreMessageAsync(String, String, ImapMessageFlags, String[], Object)
Begins asynchronous StoreMessage operation. Uploads the message read from a local file and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, string path, ImapMessageFlags flags, string[] keywords, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
String | path | The path to the mail message file. |
ImapMessageFlags | flags | Message flags. |
String[] | keywords | Keywords to set. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
Remarks
The file must be in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be uploaded using this method.
This method represents IMAP APPEND command.
Unique ID of the message will be returned if the server supports the ImapExtensions.UniqueIdPlus extension and it is enabled. See SupportedExtensions and EnabledExtensions.
StoreMessageAsync(String, MimeMessage, ImapMessageFlags, Object)
Begins asynchronous StoreMessage operation. Uploads the message to the specified folder and sets its flags.
Declaration
public Task<string> StoreMessageAsync(string folder, MimeMessage message, ImapMessageFlags flags, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | folder | Folder that will receive the message. |
MimeMessage | message | Message to upload. |
ImapMessageFlags | flags | Message flags. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Unique ID of the message, or null (Nothing in Visual Basic) if the server does not support the UIDPLUS extension. |
Remarks
This method represents IMAP APPEND command.
Unique ID of the message will be returned if the server supports the ImapExtensions.UniqueIdPlus extension and it is enabled. See SupportedExtensions and EnabledExtensions.