Skip to content

Commit d889c14

Browse files
committed
Added BCC Option
Added the option to send emails using bcc.
1 parent 3efd63e commit d889c14

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ The config file is in the scripts folder. Before first run of the script, pleas
106106
#####Email
107107
* email_enabled - Enable the creation and sending of an email
108108
* email_individually - True to send out emails individually to each address in the email_to setting
109+
* email_use_bcc - True to send emails on using bcc instead of to (email_to settings will send to them using bcc)
109110
* email_to - Array of email addresses to send the email
110111
* email_to_send_to_shared_users - True to get list of shared user emails (plex_username and plex_password must be valid for this to be used)
111112
* email_from - Email address to send the email from

scripts/config.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ web_skip_if_no_additions = False
3737
##Email
3838
email_enabled = True
3939
email_individually = False
40+
email_use_bcc = False
4041
# ['email1@gmail.com', 'email2@hotmail.com']
4142
email_to = ['']
4243
#This requires plex_username and plex_password to be filled to get emails of shared users.

scripts/plexEmail.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
def replaceConfigTokens():
2626
## The below code is for backwards compatibility
27+
if ('email_use_bcc' not in config):
28+
config['email_use_bcc'] = False
29+
2730
if ('email_to_send_to_shared_users' not in config):
2831
config['email_to_send_to_shared_users'] = False
2932

@@ -357,7 +360,8 @@ def sendMail(email):
357360
# the HTML message, is best and preferred.
358361
msg.attach(plaintext)
359362
msg.attach(htmltext)
360-
msg['To'] = ", ".join(TO)
363+
if (not config['email_use_bcc']):
364+
msg['To'] = ", ".join(TO)
361365
if (not use_ssl):
362366
server = smtplib.SMTP(smtp_address, smtp_port)
363367
server.ehlo()

0 commit comments

Comments
 (0)