Python Forum
Mail is not sent to multiple users
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mail is not sent to multiple users
#2
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())
Reply


Messages In This Thread
Mail is not sent to multiple users - by ur00361883 - Apr-24-2017, 05:18 AM
RE: Mail is not sent to multiple users - by ur00361883 - Apr-25-2017, 07:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mail issue Mihil 3 2,674 Dec-03-2020, 05:25 AM
Last Post: Mihil
  smtplib mail without subject anna 2 2,486 Apr-24-2019, 05:44 AM
Last Post: anna
  Mail Faiyaz 1 26,461 Sep-24-2018, 02:29 PM
Last Post: Larz60+
  Outlook mail watcher g_shanmuga 1 5,075 Mar-26-2018, 04:09 PM
Last Post: nilamo
  Netmiko - add multiple files, from different folders to mail. tomikovaknin 5 5,356 Nov-26-2017, 12:55 PM
Last Post: heiner55
  Simple e-mail sender, that automatically changes subject for every e-mail joker 2 3,175 Aug-24-2017, 09:45 AM
Last Post: joker

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020