Constructor
new EmailClient(auth)
- Description:
Creates a new EmailClient instance
- Source:
Parameters:
Name | Type | Description |
---|---|---|
auth |
IAuth | string | Authentication credentials or API key |
Classes
Methods
sendEmail(mailOption, additionalOptionsopt) → {Promise.<Response>}
- Description:
Sends an email with the specified configuration
- Source:
Example
const client = new EmailClient('your-api-key');
const response = await client.sendEmail({
from: { email: 'sender@example.com', name: 'Sender Name' },
to: [{ email: 'recipient@example.com', name: 'Recipient Name' }],
subject: 'Test Email',
content: {
value: '<h1>Hello World!</h1><p>This is a test email.</p>',
type: 'html'
},
});
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mailOption |
mailOption | Email configuration |
|
additionalOptions |
AdditionalEmailOptions |
<optional> |
Optional additional settings |
Returns:
Promise resolving to the email send response
- Type
- Promise.<Response>
(async) sendEmlEmail(eml, additionalOptionsopt) → {Promise.<Response>}
- Description:
Sends a pre-formatted email in raw EML format
For more information on how to we handle raw emails, please refer to the documentation:
https://docs.sendlix.com/emlemail
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eml |
string | Buffer | Uint8Array | Raw email in EML format, can be a filepath string |
|
additionalOptions |
AdditionalEmailOptions |
<optional> |
Optional additional settings |
Returns:
Promise resolving to the email send response
- Type
- Promise.<Response>
(async) sendGroupEmail(groupData) → {Promise.<number>}
- Description:
Sends an email to a group of recipients identified by a group ID
- Source:
Parameters:
Name | Type | Description |
---|---|---|
groupData |
GroupMailData | Group email configuration |
Returns:
Promise resolving to the number of emails left in the account
- Type
- Promise.<number>