Apr-25-2017, 07:00 AM
(This post was last modified: Apr-25-2017, 07:00 AM by ur00361883.)
I got the issue resolved.
The sendmail method of smtp object requires 3 inputs.
1. from address
2. to address list
3. message object converted as string.
The 3rd object : message contains the message and also header information where the to,cc,bcc,from is saved and same is shown when we see the message in browser or mail client.
But the original senders list (all to,cc,bcc) is merged as single list and sent with the 2nd argument and which should be converted to list.If not, only the first recipient will get the mail but the other recipients are visible as they exist in the header data.
So, below is the modified code block.
s.sendmail(msg["from_address"], msg["to_address"].split(','), msg_body.as_string())
The sendmail method of smtp object requires 3 inputs.
1. from address
2. to address list
3. message object converted as string.
The 3rd object : message contains the message and also header information where the to,cc,bcc,from is saved and same is shown when we see the message in browser or mail client.
But the original senders list (all to,cc,bcc) is merged as single list and sent with the 2nd argument and which should be converted to list.If not, only the first recipient will get the mail but the other recipients are visible as they exist in the header data.
So, below is the modified code block.
s.sendmail(msg["from_address"], msg["to_address"].split(','), msg_body.as_string())