send_email
send_email
Send an email with an attachment
Intended to run from biowulf
Functions
Name | Description |
---|---|
send_email_msg | Sends an email with an optional message & HTML attachment. |
send_email_msg
send_email.send_email_msg(='${USER}@hpc.nih.gov',
to_address='This is an automated email',
text='test email from python',
subject=None,
attach_html='${USER}@hpc.nih.gov',
from_addr=False,
debug )
Sends an email with an optional message & HTML attachment.
Parameters
Name | Type | Description | Default |
---|---|---|---|
to_address | str | The email address of the recipient. | '${USER}@hpc.nih.gov' |
text | str | The plain text content of the email. | 'This is an automated email' |
subject | str | The subject line of the email. | 'test email from python' |
attach_html | str | The file path to the HTML attachment. | None |
from_addr | str | The email address of the sender. | '${USER}@hpc.nih.gov' |
Raises
Name | Type | Description |
---|---|---|
FileNotFoundError | If the HTML attachment file does not exist. | |
smtplib.SMTPException | If there is an error sending the email. |