This API allows you to send a complete email that includes primary recipients (To), CC, BCC, and file attachments. It is best suited for sending detailed emails such as reports, invoices, or onboarding information where documents need to be shared.
Learn More
API Endpoint
http://msg.msgclub.net/rest/services/sendEmail/email?AUTH_KEY=your_auth_key
Headers
Content-Type: application/json
Request Body (Sample)
{
"routeId": 15,
"fromEmail": "abc@mail.com",
"fromName": "Sender Name",
"toEmailSet": [
{
"email": "toEmail1@xyz.com",
"personName": "User One"
}
],
"ccEmailSet": [
{
"email": "ccEmail1@xyz.com",
"personName": "CC User"
}
],
"bccEmailSet": [
{
"email": "bccEmail1@xyz.com",
"personName": "BCC User"
}
],
"contentType": "html",
"subject": "Test Email",
"mailContent": "This is a test email.",
"attachmentType": "1",
"attachments": [
{
"fileType": "text/plain",
"fileName": "test.txt",
"fileData": "BASE64_ENCODED_DATA"
}
]
}
Note: The payload is currently beautified for better readability. For API purposes, we require the payload in minified format.
Step-by-Step Guide
Step 1: Add API URL
Start by adding the API endpoint and replace AUTH_KEY with your actual authentication key.
Step 2: Set Headers
Make sure the header is set to application/json.
Step 3: Enter Sender Details
Provide the sender’s email (fromEmail) and name (fromName).
Step 4: Add Recipients
- Add main recipients under toEmailSet
- Add CC recipients under ccEmailSet
- Add BCC recipients under bccEmailSet
Step 5: Write Email Content
Fill in:
- Subject of the email
- Email content (mailContent)
- Content type (html or text)
Step 6: Add Attachment
- Set attachmentType to 1
- Convert your file into Base64 format
- Add file details inside the attachments section
Step 7: Send the Request
Once everything is set, send the POST request using Postman or your system.
Parameter Name with Description
| Parameter Name | Data Type | Description |
| AUTH_KEY * | Alphanumeric | Login Authentication Key(This key is unique for every user) |
| routeId * | Integer | Which route you want use for sending sms enter routeId for particular route.use given Id for route. 15- Transactional Email16- Promotional Email |
| contentType * | Text | Content type of email html for html content and text for text content. |
| mailContent * | Text | Email content that user want to sent in email. |
| subject * | Text | Email subject that user want to sent in email. |
| fromName * | Text | Name of sender. |
| fromEmail * | Text | Email id of sender like Sender Id |
| attachmentType * | Text | Current this parameter email have attachment. 0 have no attachment 1 have attechment. |
| toEmailSet * | Text | List of recipient of (To email).email: Email of recipient.personName: Name of recipient. |
| ccEmailSet * | Text | List of cc recipient of (CCemail).email:Email of CC recipient.personName:Name of CC recipient. |
| bccEmailSet * | Text | List of bcc recipient of (BCCemail).email:Email of BCC recipient.personName:Name of BCC recipient. |
| attachments * | Text | List of attachments.fileType:Type of file.fileName:Name of File.fileData:File data converted in Base64 format. |
FAQs
1. When should I use this API?
Use this API when you need to send emails with attachments and include multiple recipients in To, CC, and BCC.
2. What file formats are supported for attachments?
You can send any file type (PDF, TXT, JPG, etc.), as long as it is converted into Base64 format.
3. Is it mandatory to include CC and BCC?
No, CC and BCC are optional. You can include them only if required.
4. What happens if attachmentType is set incorrectly?
If attachmentType is set to 1 but no attachment is provided, the API may fail or return an error.
5. Can I send multiple attachments?
Yes, you can include multiple files inside the attachments array.
6. What is the difference between routeId 15 and 16?
- 15 → Transactional emails
- 16 → Promotional emails
7. What content types are supported?
You can use:
- html for formatted emails
- text for plain emails
