Account Email server account for built-in client operations.
Email client account configuration management API.
Email client uses account configurations stored in files on Aspose Cloud Storage.
These files should include email account credentials and email server configuration.
There are two types of email account configuration files.
One of them stores a single email account and has a ‘.account’ extension.
Another one has a ‘ .multi.account’ extension and used for virtual multi-account
client functions. The multi-account client should be used to manage several email
accounts as a single one. For example, you can use one request to find messages
in all accounts attached to the multi-account client.
Link to email account configuration should be provided in most of email client
API functions.
Get
Get email client account from storage.
Returns EmailClientAccount model. Requires:
request
Get method request. Type: ClientAccountGetRequest .
GetMulti
Get email client multi account file (*.multi.account). Will respond error if file extension is not ".multi.account".
Returns EmailClientMultiAccount model. Requires:
request
GetMulti method request. Type: ClientAccountGetMultiRequest .
Save
Create/update email client account file (*.account) with credentials. Requires:
request
Email account information. Type: ClientAccountSaveRequest .
C#
var request = new ClientAccountSaveRequest
{
StorageFile = new StorageFileLocation
{
FileName = "email.account" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
},
Value = new EmailClientAccount
{
Host = "smtp.example.com" ,
Port = 465 ,
SecurityOptions = "SSLAuto" ,
ProtocolType = "SMTP" ,
Credentials = new EmailClientAccountOauthCredentials
{
ClientId = "clientId" ,
ClientSecret = "clientSecret" ,
RefreshToken = "refreshToken" ,
Login = "example@example.com"
},
CacheFile = new StorageFileLocation
{
FileName = "account.cache" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
}
}
};
Java
ClientAccountSaveRequest request = Models . clientAccountSaveRequest ()
. storageFile ( Models . storageFileLocation ()
. fileName ( "email.account" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. value ( Models . emailClientAccount ()
. host ( "smtp.example.com" )
. port ( 465 )
. securityOptions ( "SSLAuto" )
. protocolType ( "SMTP" )
. credentials ( Models . emailClientAccountOauthCredentials ()
. clientId ( "clientId" )
. clientSecret ( "clientSecret" )
. refreshToken ( "refreshToken" )
. login ( "example@example.com" )
. build ())
. cacheFile ( Models . storageFileLocation ()
. fileName ( "account.cache" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. build ())
. build ();
Python
request = models . ClientAccountSaveRequest (
storage_file = models . StorageFileLocation (
file_name = 'email.account' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ),
value = models . EmailClientAccount (
host = 'smtp.example.com' ,
port = 465 ,
security_options = 'SSLAuto' ,
protocol_type = 'SMTP' ,
credentials = models . EmailClientAccountOauthCredentials (
client_id = 'clientId' ,
client_secret = 'clientSecret' ,
refresh_token = 'refreshToken' ,
login = 'example@example.com' ),
cache_file = models . StorageFileLocation (
file_name = 'account.cache' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' )))
Ruby
request = ClientAccountSaveRequest . new (
storage_file : StorageFileLocation . new (
file_name : 'email.account' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ),
value : EmailClientAccount . new (
host : 'smtp.example.com' ,
port : 465 ,
security_options : 'SSLAuto' ,
protocol_type : 'SMTP' ,
credentials : EmailClientAccountOauthCredentials . new (
client_id : 'clientId' ,
client_secret : 'clientSecret' ,
refresh_token : 'refreshToken' ,
login : 'example@example.com' ),
cache_file : StorageFileLocation . new (
file_name : 'account.cache' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' )))
Typescript
let request = Models . clientAccountSaveRequest ()
. storageFile ( Models . storageFileLocation ()
. fileName ( 'email.account' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. value ( Models . emailClientAccount ()
. host ( 'smtp.example.com' )
. port ( 465 )
. securityOptions ( 'SSLAuto' )
. protocolType ( 'SMTP' )
. credentials ( Models . emailClientAccountOauthCredentials ()
. clientId ( 'clientId' )
. clientSecret ( 'clientSecret' )
. refreshToken ( 'refreshToken' )
. login ( 'example@example.com' )
. build ())
. cacheFile ( Models . storageFileLocation ()
. fileName ( 'account.cache' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. build ())
. build ();
PHP
$request = Models :: clientAccountSaveRequest ()
-> storageFile ( Models :: storageFileLocation ()
-> fileName ( 'email.account' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> value ( Models :: emailClientAccount ()
-> host ( 'smtp.example.com' )
-> port ( 465 )
-> securityOptions ( 'SSLAuto' )
-> protocolType ( 'SMTP' )
-> credentials ( Models :: emailClientAccountOauthCredentials ()
-> clientId ( 'clientId' )
-> clientSecret ( 'clientSecret' )
-> refreshToken ( 'refreshToken' )
-> login ( 'example@example.com' )
-> build ())
-> cacheFile ( Models :: storageFileLocation ()
-> fileName ( 'account.cache' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> build ())
-> build ();
SaveMulti
Create email client multi account file (*.multi.account). Will respond error if file extension is not ".multi.account". Requires:
request
Email accounts information. Type: ClientAccountSaveMultiRequest .
C#
var request = new ClientAccountSaveMultiRequest
{
StorageFile = new StorageFileLocation
{
FileName = "email.multi.account" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
},
Value = new EmailClientMultiAccount
{
ReceiveAccounts = new List < EmailClientAccount >
{
new EmailClientAccount
{
Host = "imap.gmail.com" ,
Port = 993 ,
SecurityOptions = "SSLAuto" ,
Credentials = new EmailClientAccountPasswordCredentials
{
Password = "password" ,
Login = "example@gmail.com"
}
},
new EmailClientAccount
{
Host = "exchange@outlook.com" ,
Port = 443 ,
ProtocolType = "EWS" ,
Credentials = new EmailClientAccountOauthCredentials
{
ClientId = "clientId" ,
ClientSecret = "clientSecret" ,
RefreshToken = "refreshToken" ,
Login = "example@outlook.com"
}
}
},
SendAccount = new EmailClientAccount
{
Host = "smtp.gmail.com" ,
Port = 465 ,
SecurityOptions = "SSLAuto" ,
ProtocolType = "SMTP" ,
Credentials = new EmailClientAccountPasswordCredentials
{
Password = "password" ,
Login = "example@gmail.com"
}
}
}
};
Java
ClientAccountSaveMultiRequest request = Models . clientAccountSaveMultiRequest ()
. storageFile ( Models . storageFileLocation ()
. fileName ( "email.multi.account" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. value ( Models . emailClientMultiAccount ()
. receiveAccounts ( Arrays .< EmailClientAccount > asList (
Models . emailClientAccount ()
. host ( "imap.gmail.com" )
. port ( 993 )
. securityOptions ( "SSLAuto" )
. credentials ( Models . emailClientAccountPasswordCredentials ()
. password ( "password" )
. login ( "example@gmail.com" )
. build ())
. build (),
Models . emailClientAccount ()
. host ( "exchange@outlook.com" )
. port ( 443 )
. protocolType ( "EWS" )
. credentials ( Models . emailClientAccountOauthCredentials ()
. clientId ( "clientId" )
. clientSecret ( "clientSecret" )
. refreshToken ( "refreshToken" )
. login ( "example@outlook.com" )
. build ())
. build ()))
. sendAccount ( Models . emailClientAccount ()
. host ( "smtp.gmail.com" )
. port ( 465 )
. securityOptions ( "SSLAuto" )
. protocolType ( "SMTP" )
. credentials ( Models . emailClientAccountPasswordCredentials ()
. password ( "password" )
. login ( "example@gmail.com" )
. build ())
. build ())
. build ())
. build ();
Python
request = models . ClientAccountSaveMultiRequest (
storage_file = models . StorageFileLocation (
file_name = 'email.multi.account' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ),
value = models . EmailClientMultiAccount (
receive_accounts = [
models . EmailClientAccount (
host = 'imap.gmail.com' ,
port = 993 ,
security_options = 'SSLAuto' ,
credentials = models . EmailClientAccountPasswordCredentials (
password = 'password' ,
login = 'example@gmail.com' )),
models . EmailClientAccount (
host = 'exchange@outlook.com' ,
port = 443 ,
protocol_type = 'EWS' ,
credentials = models . EmailClientAccountOauthCredentials (
client_id = 'clientId' ,
client_secret = 'clientSecret' ,
refresh_token = 'refreshToken' ,
login = 'example@outlook.com' ))],
send_account = models . EmailClientAccount (
host = 'smtp.gmail.com' ,
port = 465 ,
security_options = 'SSLAuto' ,
protocol_type = 'SMTP' ,
credentials = models . EmailClientAccountPasswordCredentials (
password = 'password' ,
login = 'example@gmail.com' ))))
Ruby
request = ClientAccountSaveMultiRequest . new (
storage_file : StorageFileLocation . new (
file_name : 'email.multi.account' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ),
value : EmailClientMultiAccount . new (
receive_accounts : [
EmailClientAccount . new (
host : 'imap.gmail.com' ,
port : 993 ,
security_options : 'SSLAuto' ,
credentials : EmailClientAccountPasswordCredentials . new (
password : 'password' ,
login : 'example@gmail.com' )),
EmailClientAccount . new (
host : 'exchange@outlook.com' ,
port : 443 ,
protocol_type : 'EWS' ,
credentials : EmailClientAccountOauthCredentials . new (
client_id : 'clientId' ,
client_secret : 'clientSecret' ,
refresh_token : 'refreshToken' ,
login : 'example@outlook.com' )) ] ,
send_account : EmailClientAccount . new (
host : 'smtp.gmail.com' ,
port : 465 ,
security_options : 'SSLAuto' ,
protocol_type : 'SMTP' ,
credentials : EmailClientAccountPasswordCredentials . new (
password : 'password' ,
login : 'example@gmail.com' ))))
Typescript
let request = Models . clientAccountSaveMultiRequest ()
. storageFile ( Models . storageFileLocation ()
. fileName ( 'email.multi.account' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. value ( Models . emailClientMultiAccount ()
. receiveAccounts ([
Models . emailClientAccount ()
. host ( 'imap.gmail.com' )
. port ( 993 )
. securityOptions ( 'SSLAuto' )
. credentials ( Models . emailClientAccountPasswordCredentials ()
. password ( 'password' )
. login ( 'example@gmail.com' )
. build ())
. build (),
Models . emailClientAccount ()
. host ( 'exchange@outlook.com' )
. port ( 443 )
. protocolType ( 'EWS' )
. credentials ( Models . emailClientAccountOauthCredentials ()
. clientId ( 'clientId' )
. clientSecret ( 'clientSecret' )
. refreshToken ( 'refreshToken' )
. login ( 'example@outlook.com' )
. build ())
. build ()])
. sendAccount ( Models . emailClientAccount ()
. host ( 'smtp.gmail.com' )
. port ( 465 )
. securityOptions ( 'SSLAuto' )
. protocolType ( 'SMTP' )
. credentials ( Models . emailClientAccountPasswordCredentials ()
. password ( 'password' )
. login ( 'example@gmail.com' )
. build ())
. build ())
. build ())
. build ();
PHP
$request = Models :: clientAccountSaveMultiRequest ()
-> storageFile ( Models :: storageFileLocation ()
-> fileName ( 'email.multi.account' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> value ( Models :: emailClientMultiAccount ()
-> receiveAccounts ( array (
Models :: emailClientAccount ()
-> host ( 'imap.gmail.com' )
-> port ( 993 )
-> securityOptions ( 'SSLAuto' )
-> credentials ( Models :: emailClientAccountPasswordCredentials ()
-> password ( 'password' )
-> login ( 'example@gmail.com' )
-> build ())
-> build (),
Models :: emailClientAccount ()
-> host ( 'exchange@outlook.com' )
-> port ( 443 )
-> protocolType ( 'EWS' )
-> credentials ( Models :: emailClientAccountOauthCredentials ()
-> clientId ( 'clientId' )
-> clientSecret ( 'clientSecret' )
-> refreshToken ( 'refreshToken' )
-> login ( 'example@outlook.com' )
-> build ())
-> build ()))
-> sendAccount ( Models :: emailClientAccount ()
-> host ( 'smtp.gmail.com' )
-> port ( 465 )
-> securityOptions ( 'SSLAuto' )
-> protocolType ( 'SMTP' )
-> credentials ( Models :: emailClientAccountPasswordCredentials ()
-> password ( 'password' )
-> login ( 'example@gmail.com' )
-> build ())
-> build ())
-> build ())
-> build ();
More APIs