mail_reply_to_message
Reply to a received email inside its original thread, sending only to the sender or to all recipients when reply_all is enabled.
Instructions
Reply to one received message inside its thread (Re: subject, In-Reply-To and References, quoted original), to the sender or, with reply_all, to everyone.
Use when: the owner wants to answer a message you found with mail_search_messages. Not for a new conversation (use mail_send_message), passing the message to someone else (use mail_forward_message), or editing a reply already saved as a draft (use mail_update_draft). Parameters:
folder, uid and uidvalidity come from the same mail_search_messages result; omitting uidvalidity skips the renumbering check.
Omit to and the reply goes to Reply-To, else From; for a message you sent yourself it goes to that message's To.
An explicit to replaces the computed To, but reply_all=true still adds the original To and Cc. cc is added to the computed Cc.
Your own address is removed unless it is the only recipient.
body is only your new text: the signature follows it, then 'On , wrote:' and the quote unless quote_original=false. An HTML quote is built only when body_html is given. Behavior:
Same gates as mail_send_message: with SEND_REQUIRES_APPROVAL=true (the default) the reply is queued (or saved to Drafts on a local server), NOT sent; with it off it goes out at once; draft=true only saves it.
Once sent, a copy goes to Sent and the original is flagged Answered.
Every call is a new message. Returns: the mail_send_message result (status, recipients, message_id, subject, to, cc; drafts carry no uid, so find them with mail_search_messages(folder='Drafts')) plus in_reply_to, and original_marked_answered when sent now. Errors:
'No message with uid' or out-of-date uids: search again.
'Could not determine a recipient': pass to.
the recipient and SMTP errors of mail_send_message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Cc addresses (visible to all recipients). | |
| to | No | Override the computed recipients. Omit to reply to the sender (and others if reply_all). | |
| bcc | No | Bcc addresses (hidden from other recipients). | |
| uid | Yes | Message uid in that folder (from mail_search_messages). | |
| body | Yes | Your reply text only; the quoted original is added automatically. | |
| draft | No | true = save to Drafts for the user to review instead of sending. | |
| folder | Yes | Mail folder, e.g. INBOX, Sent, Archive or a custom name. | |
| body_html | No | Optional HTML version of the body; the plain-text 'body' is always required. | |
| reply_all | No | true = also reply to the other To/Cc recipients, not just the sender. | |
| attachments | No | Files to attach (from mail_get_attachment as is; from drive_get_file, name and data_base64 go in filename and content_base64). | |
| uidvalidity | No | The 'uidvalidity' from the result the uid came from: a renumbered folder is then refused, not misread. | |
| quote_original | No | true (default) = include the quoted original below your reply. |