sxolar.util.gmail
¶
Utilities for sending emails using Gmail.
send_email(subject, to, body, from_email=EMAIL_SENDER, safe=True, is_plain=True, app_password=EMAIL_APP_PASSWORD)
¶
Send an email using Gmail.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
subject
|
str
|
str, The subject of the email. |
required |
to
|
list[str]
|
str, The email address to send the email to. |
required |
body
|
str
|
str, The body of the email. |
required |
from_email
|
str
|
str, default EMAIL_SENDER, the email address to send the email from. |
EMAIL_SENDER
|
safe
|
bool
|
bool, default True, whether to suppress exceptions when sending the email. |
True
|
is_plain
|
bool
|
bool, default True, whether the email is plain text or html. |
True
|
app_password
|
str
|
str, default EMAIL_APP_PASSWORD, the app password for the Gmail account. |
EMAIL_APP_PASSWORD
|
Source code in sxolar/util/gmail.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|