-2

We have written python code that sends emails. Bcc is an array of 2 emails and there is no cc. Even though there is no CC, the BCC emails are added as CC.

Here is the code:

bcc = "x, y"
response = self.connection.send_email(
    source = sender_mail,
    subject = subject,
    body = None,
    to_addresses = to,
    cc_addresses=None,
    bcc_addresses=bcc,
    format='html',
    reply_addresses = None,
    return_path = None,
    text_body=None,
    html_body=html
)

Any idea how we can solve this?

stelioslogothetis
  • 9,371
  • 3
  • 28
  • 53
Ira Shyti
  • 224
  • 1
  • 3
  • `bcc = "x, y"` is not an array of two emails, it is a string. It should be something like `bcc = ['x@example.com', 'y@example.com']`. – Alasdair Aug 14 '17 at 12:23
  • That right. It was written correctly in the code though. Found what the problem is. We figured out the problem. We use nohup on the email sending process. So when we restarted it the problem was solved. – Ira Shyti Aug 15 '17 at 11:41

1 Answers1

0
bcc = "x, y"

is not an array. Rather go for:

bcc = [x, y]
DonGru
  • 13,532
  • 8
  • 45
  • 55