Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send e-mail to distribution list in Python [closed]

I have a Python scripts which successfully sends e-mails to users whenever I provide a coma separated list of e-mails.

oSender = "My Email <[email protected]>"
oRecipient = pRecipient.split(",") #convert comma separated list of recipient into python list object
[...] building the e-mail body [...]
#send e-mail via smtp server
oConnexion = smtplib.SMTP('smtp.company.org',25)
oConnexion.sendmail(oSender, oRecipient, oEmail.as_string())
oConnexion.quit()

However, when the recipients list contains a distribution list such as [email protected], no user from the distribution list receive anything. I do not get any error message either so I am thinking this could be related to the configuration of the distribution list itself?

Please note this is not a local distribution list created in my Outlook but rather a company wide distribution list set-up on some server.

like image 460
Alexis.Rolland Avatar asked Aug 04 '26 11:08

Alexis.Rolland


1 Answers

So discussing with our internal teams, we figured out this was because the distribution list was not configured to receive e-mails from outside our company or from anonymous applications.

like image 102
Alexis.Rolland Avatar answered Aug 06 '26 03:08

Alexis.Rolland