{"id":3429,"date":"2026-04-10T19:43:47","date_gmt":"2026-04-10T14:13:47","guid":{"rendered":"https:\/\/www.msgclub.net\/learn\/?p=3429"},"modified":"2026-04-10T19:43:47","modified_gmt":"2026-04-10T14:13:47","slug":"send-email-post-with-cc-bcc-attachment","status":"publish","type":"post","link":"https:\/\/www.msgclub.net\/learn\/send-email-post-with-cc-bcc-attachment.html","title":{"rendered":"Send Email (POST) \u2013 With CC, BCC &amp; Attachment"},"content":{"rendered":"\n<p>This API allows you to send a complete email that includes <strong>primary recipients (To), CC, BCC, and file attachments<\/strong>. It is best suited for sending detailed emails such as reports, invoices, or onboarding information where documents need to be shared.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Learn-More\">Learn More<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#sbsg_send_email\" data-type=\"internal\" data-id=\"#sbsg_send_email\">Step by Step Guide<\/a><\/li>\n\n\n\n<li><a href=\"#faqs_send_email\">FAQs<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>API Endpoint<\/strong><\/h2>\n\n\n\n<p>http:\/\/<a href=\"http:\/\/msg.msgclub.net\">msg.msgclub.net<\/a>\/rest\/services\/sendEmail\/email?AUTH_KEY=your_auth_key<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Headers<\/strong><\/h2>\n\n\n\n<p>Content-Type: application\/json<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Request Body (Sample)<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"routeId\": 15,\n  \"fromEmail\": \"abc@mail.com\",\n  \"fromName\": \"Sender Name\",\n  \"toEmailSet\": &#91;\n    {\n      \"email\": \"toEmail1@xyz.com\",\n      \"personName\": \"User One\"\n    }\n  ],\n  \"ccEmailSet\": &#91;\n    {\n      \"email\": \"ccEmail1@xyz.com\",\n      \"personName\": \"CC User\"\n    }\n  ],\n  \"bccEmailSet\": &#91;\n    {\n      \"email\": \"bccEmail1@xyz.com\",\n      \"personName\": \"BCC User\"\n    }\n  ],\n  \"contentType\": \"html\",\n  \"subject\": \"Test Email\",\n  \"mailContent\": \"This is a test email.\",\n  \"attachmentType\": \"1\",\n  \"attachments\": &#91;\n    {\n      \"fileType\": \"text\/plain\",\n      \"fileName\": \"test.txt\",\n      \"fileData\": \"BASE64_ENCODED_DATA\"\n    }\n  ]\n}<\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>The payload is currently beautified for better readability. For API purposes, we require the payload in minified format.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sbsg_send_email\"><strong>Step-by-Step Guide<\/strong><\/h2>\n\n\n\n<p><strong>Step 1: Add API URL<\/strong><strong><br><\/strong>Start by adding the API endpoint and replace AUTH_KEY with your actual authentication key.<\/p>\n\n\n\n<p><strong>Step 2: Set Headers<\/strong><strong><br><\/strong>Make sure the header is set to application\/json.<\/p>\n\n\n\n<p><strong>Step 3: Enter Sender Details<\/strong><strong><br><\/strong>Provide the sender\u2019s email (fromEmail) and name (fromName).<\/p>\n\n\n\n<p><strong>Step 4: Add Recipients<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add main recipients under toEmailSet<\/li>\n\n\n\n<li>Add CC recipients under ccEmailSet<\/li>\n\n\n\n<li>Add BCC recipients under bccEmailSet<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 5: Write Email Content<\/strong><strong><br><\/strong>Fill in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Subject of the email<\/li>\n\n\n\n<li>Email content (mailContent)<\/li>\n\n\n\n<li>Content type (html or text)<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 6: Add Attachment<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set attachmentType to 1<\/li>\n\n\n\n<li>Convert your file into Base64 format<\/li>\n\n\n\n<li>Add file details inside the attachments section<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 7: Send the Request<\/strong><strong><br><\/strong>Once everything is set, send the POST request using Postman or your system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Parameter Name with Description<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Parameter Name<\/td><td>Data Type<\/td><td>Description<\/td><\/tr><tr><td>AUTH_KEY *<\/td><td>Alphanumeric<\/td><td>Login Authentication Key(This key is unique for every user)<\/td><\/tr><tr><td>routeId *<\/td><td>Integer<\/td><td>Which route you want use for sending sms enter routeId for particular route.use given Id for route. 15- Transactional Email16- Promotional Email<\/td><\/tr><tr><td>contentType *<\/td><td>Text<\/td><td>Content type of email html for html content and text for text content.<\/td><\/tr><tr><td>mailContent *<\/td><td>Text<\/td><td>Email content that user want to sent in email.<\/td><\/tr><tr><td>subject *<\/td><td>Text<\/td><td>Email subject that user want to sent in email.<\/td><\/tr><tr><td>fromName *<\/td><td>Text<\/td><td>Name of sender.<\/td><\/tr><tr><td>fromEmail *<\/td><td>Text<\/td><td>Email id of sender like Sender Id<\/td><\/tr><tr><td>attachmentType *<\/td><td>Text<\/td><td>Current this parameter email have attachment. 0 have no attachment 1 have attechment.<\/td><\/tr><tr><td>toEmailSet *<\/td><td>Text<\/td><td>List of recipient of (To email).email: Email of recipient.personName: Name of recipient.<\/td><\/tr><tr><td>ccEmailSet *<\/td><td>Text<\/td><td>List of cc recipient of (CCemail).email:Email of CC recipient.personName:Name of CC recipient.<\/td><\/tr><tr><td>bccEmailSet *<\/td><td>Text<\/td><td>List of bcc recipient of (BCCemail).email:Email of BCC recipient.personName:Name of BCC recipient.<\/td><\/tr><tr><td>attachments *<\/td><td>Text<\/td><td>List of attachments.fileType:Type of file.fileName:Name of File.fileData:File data converted in Base64 format.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faqs_send_email\"><strong>FAQs<\/strong><\/h2>\n\n\n\n<p><strong>1. When should I use this API?<\/strong><strong><br><\/strong> Use this API when you need to send emails with <strong>attachments<\/strong> and include multiple recipients in <strong>To, CC, and BCC<\/strong>.<\/p>\n\n\n\n<p><strong>2. What file formats are supported for attachments?<\/strong><strong><br><\/strong> You can send any file type (PDF, TXT, JPG, etc.), as long as it is converted into <strong>Base64 format<\/strong>.<\/p>\n\n\n\n<p><strong>3. Is it mandatory to include CC and BCC?<\/strong><strong><br><\/strong> No, CC and BCC are optional. You can include them only if required.<\/p>\n\n\n\n<p><strong>4. What happens if <\/strong><strong>attachmentType<\/strong><strong> is set incorrectly?<\/strong><strong><br><\/strong> If attachmentType is set to 1 but no attachment is provided, the API may fail or return an error.<\/p>\n\n\n\n<p><strong>5. Can I send multiple attachments?<\/strong><strong><br><\/strong> Yes, you can include multiple files inside the attachments array.<\/p>\n\n\n\n<p><strong>6. What is the difference between routeId 15 and 16?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>15 \u2192 Transactional emails<\/li>\n\n\n\n<li>16 \u2192 Promotional emails<\/li>\n<\/ul>\n\n\n\n<p><strong>7. What content types are supported?<\/strong><strong><br><\/strong> You can use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>html for formatted emails<\/li>\n\n\n\n<li>text for plain emails<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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) Note: The payload is&hellip; <a class=\"more-link\" href=\"https:\/\/www.msgclub.net\/learn\/send-email-post-with-cc-bcc-attachment.html\">Continue reading <span class=\"screen-reader-text\">Send Email (POST) \u2013 With CC, BCC &amp; Attachment<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164],"tags":[264,1013,172,1010,695,1007,1008,1012,1009,1011],"class_list":["post-3429","post","type-post","status-publish","format-standard","hentry","category-email","tag-api-integration","tag-base64-attachment","tag-bulk-email","tag-cc-bcc-email","tag-email-api","tag-email-with-attachment","tag-post-api","tag-promotional-email","tag-send-email","tag-transactional-email","entry"],"_links":{"self":[{"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/posts\/3429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/comments?post=3429"}],"version-history":[{"count":1,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/posts\/3429\/revisions"}],"predecessor-version":[{"id":3430,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/posts\/3429\/revisions\/3430"}],"wp:attachment":[{"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/media?parent=3429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/categories?post=3429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msgclub.net\/learn\/wp-json\/wp\/v2\/tags?post=3429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}