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(
to_address='${USER}@hpc.nih.gov',
text='This is an automated email',
subject='test email from python',
attach_html=None,
from_addr='${USER}@hpc.nih.gov',
debug=False,
)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. |