@@ -272,22 +272,26 @@ def send_mail(
272272 to_recipients ,
273273 cc_recipients = None ,
274274 bcc_recipients = None ,
275+ reply_to = None ,
275276 save_to_sent_items = False ,
277+ body_type = "Text" ,
276278 ):
277- # type: (str, str|ItemBody, List[str], List[str], List[str], bool) -> Message
279+ # type: (str, str|ItemBody, List[str], List[str]|None , List[str]|None, List[str]|None, bool, str ) -> Message
278280 """Send a new message on the fly
279281
280282 :param str subject: The subject of the message.
281283 :param str body: The body of the message. It can be in HTML or text format
282284 :param list[str] to_recipients: The To: recipients for the message.
283285 :param list[str] cc_recipients: The CC: recipients for the message.
284286 :param list[str] bcc_recipients: The BCC: recipients for the message.
287+ :param list[str] reply_to: The Reply-To: : recipients for the reply to the message.
285288 :param bool save_to_sent_items: Indicates whether to save the message in Sent Items. Specify it only if
286289 the parameter is false; default is true
290+ :param str body_type: The type of the message body. It can be "HTML" or "Text". Default is "Text".
287291 """
288292 return_type = Message (self .context )
289293 return_type .subject = subject
290- return_type .body = body
294+ return_type .body = ( body , body_type )
291295 [
292296 return_type .to_recipients .add (Recipient .from_email (email ))
293297 for email in to_recipients
@@ -302,6 +306,11 @@ def send_mail(
302306 return_type .cc_recipients .add (Recipient .from_email (email ))
303307 for email in cc_recipients
304308 ]
309+ if reply_to is not None :
310+ [
311+ return_type .reply_to .add (Recipient .from_email (email ))
312+ for email in reply_to
313+ ]
305314
306315 payload = {"message" : return_type , "saveToSentItems" : save_to_sent_items }
307316 qry = ServiceOperationQuery (self , "sendmail" , None , payload )
0 commit comments