@@ -272,22 +272,26 @@ def send_mail(
272
272
to_recipients ,
273
273
cc_recipients = None ,
274
274
bcc_recipients = None ,
275
+ reply_to = None ,
275
276
save_to_sent_items = False ,
277
+ body_type = "Text" ,
276
278
):
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
278
280
"""Send a new message on the fly
279
281
280
282
:param str subject: The subject of the message.
281
283
:param str body: The body of the message. It can be in HTML or text format
282
284
:param list[str] to_recipients: The To: recipients for the message.
283
285
:param list[str] cc_recipients: The CC: recipients for the message.
284
286
: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.
285
288
:param bool save_to_sent_items: Indicates whether to save the message in Sent Items. Specify it only if
286
289
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".
287
291
"""
288
292
return_type = Message (self .context )
289
293
return_type .subject = subject
290
- return_type .body = body
294
+ return_type .body = ( body , body_type )
291
295
[
292
296
return_type .to_recipients .add (Recipient .from_email (email ))
293
297
for email in to_recipients
@@ -302,6 +306,11 @@ def send_mail(
302
306
return_type .cc_recipients .add (Recipient .from_email (email ))
303
307
for email in cc_recipients
304
308
]
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
+ ]
305
314
306
315
payload = {"message" : return_type , "saveToSentItems" : save_to_sent_items }
307
316
qry = ServiceOperationQuery (self , "sendmail" , None , payload )
0 commit comments