Email Email document (*.eml) operations.
AsFile
Converts Email model to a specified format and returns as a file.
Returns a File . Requires:
request
Email model and format to convert. Type: EmailAsFileRequest .
C#
var request = new EmailAsFileRequest
{
Value = new EmailDto
{
Attachments = new List < Attachment >
{
new Attachment
{
Name = "some-file.txt" ,
Base64Data = "U29tZSBmaWxlIGNvbnRlbnQ="
}
},
Body = "Some body" ,
BodyType = "Html" ,
DeliveryNotificationOptions = new List < EmailDeliveryNotificationOptions >
{
"OnSuccess" ,
"Delay"
},
From = new MailAddress
{
DisplayName = "From Address" ,
Address = "from@aspose.com"
},
HtmlBody = "<b>Some body</b>" ,
IsBodyHtml = true ,
IsDraft = true ,
Subject = "Re: Some subject" ,
To = new List < MailAddress >
{
new MailAddress
{
DisplayName = "To Address" ,
Address = "to@aspose.com"
}
}
}
};
Java
EmailAsFileRequest request = Models . emailAsFileRequest ()
. value ( Models . emailDto ()
. attachments ( Arrays .< Attachment > asList (
Models . attachment ()
. name ( "some-file.txt" )
. base64Data ( "U29tZSBmaWxlIGNvbnRlbnQ=" )
. build ()))
. body ( "Some body" )
. bodyType ( "Html" )
. deliveryNotificationOptions ( Arrays .< EmailDeliveryNotificationOptions > asList (
"OnSuccess" ,
"Delay" ))
. from ( Models . mailAddress ()
. displayName ( "From Address" )
. address ( "from@aspose.com" )
. build ())
. htmlBody ( "<b>Some body</b>" )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( "Re: Some subject" )
. to ( Arrays .< MailAddress > asList (
Models . mailAddress ()
. displayName ( "To Address" )
. address ( "to@aspose.com" )
. build ()))
. build ())
. build ();
Python
request = models . EmailAsFileRequest (
value = models . EmailDto (
attachments = [
models . Attachment (
name = 'some-file.txt' ,
base64_data = 'U29tZSBmaWxlIGNvbnRlbnQ=' )],
body = 'Some body' ,
body_type = 'Html' ,
delivery_notification_options = [
'OnSuccess' ,
'Delay' ],
_from = models . MailAddress (
display_name = 'From Address' ,
address = 'from@aspose.com' ),
html_body = '<b>Some body</b>' ,
is_body_html = True ,
is_draft = True ,
subject = 'Re: Some subject' ,
to = [
models . MailAddress (
display_name = 'To Address' ,
address = 'to@aspose.com' )]))
Ruby
request = EmailAsFileRequest . new (
value : EmailDto . new (
attachments : [
Attachment . new (
name : 'some-file.txt' ,
base64_data : 'U29tZSBmaWxlIGNvbnRlbnQ=' ) ] ,
body : 'Some body' ,
body_type : 'Html' ,
delivery_notification_options : [
'OnSuccess' ,
'Delay' ] ,
from : MailAddress . new (
display_name : 'From Address' ,
address : 'from@aspose.com' ),
html_body : '<b>Some body</b>' ,
is_body_html : true ,
is_draft : true ,
subject : 'Re: Some subject' ,
to : [
MailAddress . new (
display_name : 'To Address' ,
address : 'to@aspose.com' ) ] ))
Typescript
let request = Models . emailAsFileRequest ()
. value ( Models . emailDto ()
. attachments ([
Models . attachment ()
. name ( 'some-file.txt' )
. base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
. build ()])
. body ( 'Some body' )
. bodyType ( 'Html' )
. deliveryNotificationOptions ([
'OnSuccess' ,
'Delay' ])
. from ( Models . mailAddress ()
. displayName ( 'From Address' )
. address ( 'from@aspose.com' )
. build ())
. htmlBody ( '<b>Some body</b>' )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( 'Re: Some subject' )
. to ([
Models . mailAddress ()
. displayName ( 'To Address' )
. address ( 'to@aspose.com' )
. build ()])
. build ())
. build ();
PHP
$request = Models :: emailAsFileRequest ()
-> value ( Models :: emailDto ()
-> attachments ( array (
Models :: attachment ()
-> name ( 'some-file.txt' )
-> base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
-> build ()))
-> body ( 'Some body' )
-> bodyType ( 'Html' )
-> deliveryNotificationOptions ( array (
'OnSuccess' ,
'Delay' ))
-> from ( Models :: mailAddress ()
-> displayName ( 'From Address' )
-> address ( 'from@aspose.com' )
-> build ())
-> htmlBody ( '<b>Some body</b>' )
-> isBodyHtml ( true )
-> isDraft ( true )
-> subject ( 'Re: Some subject' )
-> to ( array (
Models :: mailAddress ()
-> displayName ( 'To Address' )
-> address ( 'to@aspose.com' )
-> build ()))
-> build ())
-> build ();
AsMapi
Converts EmailDto to MapiMessageDto.
Returns MapiMessageDto model. Requires:
emailDto
Email model to convert. Type: EmailDto .
C#
var emailDto = new EmailDto
{
Attachments = new List < Attachment >
{
new Attachment
{
Name = "some-file.txt" ,
Base64Data = "U29tZSBmaWxlIGNvbnRlbnQ="
}
},
Body = "Some body" ,
BodyType = "Html" ,
DeliveryNotificationOptions = new List < EmailDeliveryNotificationOptions >
{
"OnSuccess" ,
"Delay"
},
From = new MailAddress
{
DisplayName = "From Address" ,
Address = "from@aspose.com"
},
HtmlBody = "<b>Some body</b>" ,
IsBodyHtml = true ,
IsDraft = true ,
Subject = "Re: Some subject" ,
To = new List < MailAddress >
{
new MailAddress
{
DisplayName = "To Address" ,
Address = "to@aspose.com"
}
}
};
Java
EmailDto emailDto = Models . emailDto ()
. attachments ( Arrays .< Attachment > asList (
Models . attachment ()
. name ( "some-file.txt" )
. base64Data ( "U29tZSBmaWxlIGNvbnRlbnQ=" )
. build ()))
. body ( "Some body" )
. bodyType ( "Html" )
. deliveryNotificationOptions ( Arrays .< EmailDeliveryNotificationOptions > asList (
"OnSuccess" ,
"Delay" ))
. from ( Models . mailAddress ()
. displayName ( "From Address" )
. address ( "from@aspose.com" )
. build ())
. htmlBody ( "<b>Some body</b>" )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( "Re: Some subject" )
. to ( Arrays .< MailAddress > asList (
Models . mailAddress ()
. displayName ( "To Address" )
. address ( "to@aspose.com" )
. build ()))
. build ();
Python
email_dto = models . EmailDto (
attachments = [
models . Attachment (
name = 'some-file.txt' ,
base64_data = 'U29tZSBmaWxlIGNvbnRlbnQ=' )],
body = 'Some body' ,
body_type = 'Html' ,
delivery_notification_options = [
'OnSuccess' ,
'Delay' ],
_from = models . MailAddress (
display_name = 'From Address' ,
address = 'from@aspose.com' ),
html_body = '<b>Some body</b>' ,
is_body_html = True ,
is_draft = True ,
subject = 'Re: Some subject' ,
to = [
models . MailAddress (
display_name = 'To Address' ,
address = 'to@aspose.com' )])
Ruby
email_dto = EmailDto . new (
attachments : [
Attachment . new (
name : 'some-file.txt' ,
base64_data : 'U29tZSBmaWxlIGNvbnRlbnQ=' ) ] ,
body : 'Some body' ,
body_type : 'Html' ,
delivery_notification_options : [
'OnSuccess' ,
'Delay' ] ,
from : MailAddress . new (
display_name : 'From Address' ,
address : 'from@aspose.com' ),
html_body : '<b>Some body</b>' ,
is_body_html : true ,
is_draft : true ,
subject : 'Re: Some subject' ,
to : [
MailAddress . new (
display_name : 'To Address' ,
address : 'to@aspose.com' ) ] )
Typescript
let emailDto = Models . emailDto ()
. attachments ([
Models . attachment ()
. name ( 'some-file.txt' )
. base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
. build ()])
. body ( 'Some body' )
. bodyType ( 'Html' )
. deliveryNotificationOptions ([
'OnSuccess' ,
'Delay' ])
. from ( Models . mailAddress ()
. displayName ( 'From Address' )
. address ( 'from@aspose.com' )
. build ())
. htmlBody ( '<b>Some body</b>' )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( 'Re: Some subject' )
. to ([
Models . mailAddress ()
. displayName ( 'To Address' )
. address ( 'to@aspose.com' )
. build ()])
. build ();
PHP
$email_dto = Models :: emailDto ()
-> attachments ( array (
Models :: attachment ()
-> name ( 'some-file.txt' )
-> base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
-> build ()))
-> body ( 'Some body' )
-> bodyType ( 'Html' )
-> deliveryNotificationOptions ( array (
'OnSuccess' ,
'Delay' ))
-> from ( Models :: mailAddress ()
-> displayName ( 'From Address' )
-> address ( 'from@aspose.com' )
-> build ())
-> htmlBody ( '<b>Some body</b>' )
-> isBodyHtml ( true )
-> isDraft ( true )
-> subject ( 'Re: Some subject' )
-> to ( array (
Models :: mailAddress ()
-> displayName ( 'To Address' )
-> address ( 'to@aspose.com' )
-> build ()))
-> build ();
Convert
Converts email document to specified format and returns as file.
Email documents could be stored in different formats including EML, and Outlook MSG formats.
Also sometimes users need to convert email messages to HTML format, to view them in a web browser.
Returns a File . Requires:
request
Convert method request. Type: EmailConvertRequest .
FromFile
Converts email document to a model representation.
Returns EmailDto model. Requires:
request
FromFile method request. Type: EmailFromFileRequest .
Get
Get email document from storage.
Returns EmailDto model. Requires:
request
Get method request. Type: EmailGetRequest .
GetAsFile
Converts email document from storage to specified format and returns as file.
Returns a File . Requires:
request
GetAsFile method request. Type: EmailGetAsFileRequest .
GetList
Get email list from storage folder.
Returns EmailStorageList model. Requires:
request
GetList method request. Type: EmailGetListRequest .
C#
var request = new EmailGetListRequest
{
Format = "Eml" ,
Folder = "folder/on/storage" ,
Storage = "First Storage" ,
ItemsPerPage = 10 ,
PageNumber = 0
};
Java
EmailGetListRequest request = Models . emailGetListRequest ()
. format ( "Eml" )
. folder ( "folder/on/storage" )
. storage ( "First Storage" )
. itemsPerPage ( 10 )
. pageNumber ( 0 )
. build ();
Python
request = models . EmailGetListRequest (
format = 'Eml' ,
folder = 'folder/on/storage' ,
storage = 'First Storage' ,
items_per_page = 10 ,
page_number = 0 )
Ruby
request = EmailGetListRequest . new (
format : 'Eml' ,
folder : 'folder/on/storage' ,
storage : 'First Storage' ,
items_per_page : 10 ,
page_number : 0 )
Typescript
let request = Models . EmailGetListRequest ()
. format ( 'Eml' )
. folder ( 'folder/on/storage' )
. storage ( 'First Storage' )
. itemsPerPage ( 10 )
. pageNumber ( 0 )
. build ();
PHP
$request = Models :: EmailGetListRequest ()
-> format ( 'Eml' )
-> folder ( 'folder/on/storage' )
-> storage ( 'First Storage' )
-> items_per_page ( 10 )
-> page_number ( 0 )
-> build ();
Save
Save email document to storage. Requires:
request
Email document create/update request. Type: EmailSaveRequest .
C#
var request = new EmailSaveRequest
{
Format = "Msg" ,
StorageFile = new StorageFileLocation
{
FileName = "email.eml" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
},
Value = new EmailDto
{
Attachments = new List < Attachment >
{
new Attachment
{
Name = "some-file.txt" ,
Base64Data = "U29tZSBmaWxlIGNvbnRlbnQ="
}
},
Body = "Some body" ,
BodyType = "Html" ,
DeliveryNotificationOptions = new List < EmailDeliveryNotificationOptions >
{
"OnSuccess" ,
"Delay"
},
From = new MailAddress
{
DisplayName = "From Address" ,
Address = "from@aspose.com"
},
HtmlBody = "<b>Some body</b>" ,
IsBodyHtml = true ,
IsDraft = true ,
Subject = "Re: Some subject" ,
To = new List < MailAddress >
{
new MailAddress
{
DisplayName = "To Address" ,
Address = "to@aspose.com"
}
}
}
};
Java
EmailSaveRequest request = Models . emailSaveRequest ()
. format ( "Msg" )
. storageFile ( Models . storageFileLocation ()
. fileName ( "email.eml" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. value ( Models . emailDto ()
. attachments ( Arrays .< Attachment > asList (
Models . attachment ()
. name ( "some-file.txt" )
. base64Data ( "U29tZSBmaWxlIGNvbnRlbnQ=" )
. build ()))
. body ( "Some body" )
. bodyType ( "Html" )
. deliveryNotificationOptions ( Arrays .< EmailDeliveryNotificationOptions > asList (
"OnSuccess" ,
"Delay" ))
. from ( Models . mailAddress ()
. displayName ( "From Address" )
. address ( "from@aspose.com" )
. build ())
. htmlBody ( "<b>Some body</b>" )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( "Re: Some subject" )
. to ( Arrays .< MailAddress > asList (
Models . mailAddress ()
. displayName ( "To Address" )
. address ( "to@aspose.com" )
. build ()))
. build ())
. build ();
Python
request = models . EmailSaveRequest (
format = 'Msg' ,
storage_file = models . StorageFileLocation (
file_name = 'email.eml' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ),
value = models . EmailDto (
attachments = [
models . Attachment (
name = 'some-file.txt' ,
base64_data = 'U29tZSBmaWxlIGNvbnRlbnQ=' )],
body = 'Some body' ,
body_type = 'Html' ,
delivery_notification_options = [
'OnSuccess' ,
'Delay' ],
_from = models . MailAddress (
display_name = 'From Address' ,
address = 'from@aspose.com' ),
html_body = '<b>Some body</b>' ,
is_body_html = True ,
is_draft = True ,
subject = 'Re: Some subject' ,
to = [
models . MailAddress (
display_name = 'To Address' ,
address = 'to@aspose.com' )]))
Ruby
request = EmailSaveRequest . new (
format : 'Msg' ,
storage_file : StorageFileLocation . new (
file_name : 'email.eml' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ),
value : EmailDto . new (
attachments : [
Attachment . new (
name : 'some-file.txt' ,
base64_data : 'U29tZSBmaWxlIGNvbnRlbnQ=' ) ] ,
body : 'Some body' ,
body_type : 'Html' ,
delivery_notification_options : [
'OnSuccess' ,
'Delay' ] ,
from : MailAddress . new (
display_name : 'From Address' ,
address : 'from@aspose.com' ),
html_body : '<b>Some body</b>' ,
is_body_html : true ,
is_draft : true ,
subject : 'Re: Some subject' ,
to : [
MailAddress . new (
display_name : 'To Address' ,
address : 'to@aspose.com' ) ] ))
Typescript
let request = Models . emailSaveRequest ()
. format ( 'Msg' )
. storageFile ( Models . storageFileLocation ()
. fileName ( 'email.eml' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. value ( Models . emailDto ()
. attachments ([
Models . attachment ()
. name ( 'some-file.txt' )
. base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
. build ()])
. body ( 'Some body' )
. bodyType ( 'Html' )
. deliveryNotificationOptions ([
'OnSuccess' ,
'Delay' ])
. from ( Models . mailAddress ()
. displayName ( 'From Address' )
. address ( 'from@aspose.com' )
. build ())
. htmlBody ( '<b>Some body</b>' )
. isBodyHtml ( true )
. isDraft ( true )
. subject ( 'Re: Some subject' )
. to ([
Models . mailAddress ()
. displayName ( 'To Address' )
. address ( 'to@aspose.com' )
. build ()])
. build ())
. build ();
PHP
$request = Models :: emailSaveRequest ()
-> format ( 'Msg' )
-> storageFile ( Models :: storageFileLocation ()
-> fileName ( 'email.eml' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> value ( Models :: emailDto ()
-> attachments ( array (
Models :: attachment ()
-> name ( 'some-file.txt' )
-> base64Data ( 'U29tZSBmaWxlIGNvbnRlbnQ=' )
-> build ()))
-> body ( 'Some body' )
-> bodyType ( 'Html' )
-> deliveryNotificationOptions ( array (
'OnSuccess' ,
'Delay' ))
-> from ( Models :: mailAddress ()
-> displayName ( 'From Address' )
-> address ( 'from@aspose.com' )
-> build ())
-> htmlBody ( '<b>Some body</b>' )
-> isBodyHtml ( true )
-> isDraft ( true )
-> subject ( 'Re: Some subject' )
-> to ( array (
Models :: mailAddress ()
-> displayName ( 'To Address' )
-> address ( 'to@aspose.com' )
-> build ()))
-> build ())
-> build ();
More APIs