Here is my function that i am using to send email. I have tries comma sepaarted string array also for all emails but nothing worked for me.
def send_confirmation_email(doc, subject, message, sender_email):
"""Send confirmation email to the sender"""
try:
logging.info(f"Sending confirmation email to {doc.sender} with subject: {subject} with cc: {doc.cc} and bcc: {doc.bcc}")
frappe.sendmail(
recipients=[doc.sender],
sender=sender_email,
subject=subject,
cc=doc.cc,
message=message,
reference_doctype=doc.doctype,
reference_name=doc.name,
now=True
)
logging.info(f"Email sent successfully to {doc.sender}")
except Exception as e:
logging.error(f"Error sending email: {str(e)}")
raise