{"id":6517,"date":"2022-01-09T21:13:16","date_gmt":"2022-01-09T20:13:16","guid":{"rendered":"https:\/\/help.cirrus-shield.com\/docs\/developer-guide\/rest-api\/sendemailwithattachments\/"},"modified":"2026-09-24T09:44:32","modified_gmt":"2026-09-24T08:44:32","slug":"sendemailwithattachments","status":"publish","type":"docs","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/rest-api\/sendemailwithattachments\/","title":{"rendered":"9. SendEmailWithAttachments"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-luminous-vivid-orange-color\"><u>URL:<\/u> <\/span><\/strong><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\u00ab POST \/RestApi\/SendEmailWithAttachments \u00bb<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-luminous-vivid-orange-color\"><u>Method:<\/u>\u00a0<\/span><\/strong>POST<br><\/li><li><strong><u><span class=\"has-inline-color has-luminous-vivid-orange-color\">Authentication:<\/span><\/u><\/strong> Include an OAuth 2.0 access token in the <code>Authorization: Bearer &lt;access_token&gt;<\/code> header of every call. See <a href=\"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/rest-api\/authtoken\/\">1. AuthToken \u2014 OAuth 2.0 Authentication<\/a> for how to obtain one.<\/li><li><strong><u><span class=\"has-inline-color has-luminous-vivid-orange-color\">URL Settings:<\/span><\/u><\/strong><ul><li>emailFrom [string] [Required]=The email address of the sender. This setting must have one of these two values: \u201cOrg\u201d or \u201cCurrentUser\u201d. If the value is \u201cOrg\u201d then the sender\u2019s email will be the one defined on the Organization page of the Configuration menu. If the value is \u201cCurrentUser\u201d then the sender\u2019s email will be the one of the logged in user (the one that enabled the authentication token to be generated).<\/li><\/ul><ul><li>emailTo [string] [Required]=the recipient\u2019s email address (es). If there are several values, separate them with \u201c;<\/li><li>emailCC [string] [Required]=the email address (es) to be copied. If there are several values, separate them with \u201c;\u201d.<\/li><li>emailBCC [string] [Required]=the email address to be cached. If there are several values, separate them with \u201c;\u201d.<\/li><li>emailReplyTo [string] [Required]=the email address to be cached. If there are several values, separate them with \u201c;\u201d.<\/li><li>emailSubject [string] [Required]=the email subject<\/li><li>emailIsBodyHtml [boolean] [Required]= allows you to define whether the body of the email is in text or in HTML. Possible values: true or false.<\/li><li>enableSsl [boolean] [Required]=allows you to specify whether the connection to the SMTP server must be done in SSL or not. Possible values: true or false.<\/li><li>emailBodyAndAttachments [JObject] [Required]=the body and attachments of the email stored in a subject.<\/li><\/ul><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><u><span class=\"has-inline-color has-luminous-vivid-orange-color\">Success Response:<\/span><\/u><\/strong><ul><li>Status Code=200 (OK)<br><\/li><\/ul><\/li><li><strong><u><span class=\"has-inline-color has-luminous-vivid-orange-color\">Error Response:<\/span><\/u><\/strong><ul><li>Status Code=400 (BadRequest) (in case there is an error in the data sent in the request)<\/li><\/ul><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SendEmail () method uses the SMTP configuration defined on the Organization page in the configuration area. If no SMTP server and credentials are defined, the SendEmail () method will default to the SMTP credentials defined at the current user level.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":944,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_is_vendor_doc":"0","footnotes":""},"doc_tag":[],"class_list":["post-6517","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/6517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/comments?post=6517"}],"version-history":[{"count":6,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/6517\/revisions"}],"predecessor-version":[{"id":12267,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/6517\/revisions\/12267"}],"up":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/944"}],"next":[{"title":"Source code examples","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/rest-api\/source-code-examples\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/6450"}],"prev":[{"title":"8. SendEmail","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/rest-api\/sendemail\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/6509"}],"wp:attachment":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/media?parent=6517"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/doc_tag?post=6517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}