Email Sender Module
EmailSender
dadosfera.services.email_sender.email_sender.EmailSender
EmailSender(smtp_server, port, from_email, password, use_ssl=False)
Initializes the EmailSender class.
PARAMETER | DESCRIPTION |
---|---|
smtp_server
|
SMTP server.
TYPE:
|
port
|
SMTP server port.
TYPE:
|
from_email
|
Sender's email.
TYPE:
|
app_password
|
APP password to SMTP authenticate.
TYPE:
|
Source code in dadosfera/services/email_sender/email_sender.py
30 31 32 33 34 35 36 37 38 39 |
|
create_message
create_message(to_email, subject, body, mimetype=PLAIN, attachment_path=None)
Creates an email message.
PARAMETER | DESCRIPTION |
---|---|
to_email
|
Recipient's email(s).
TYPE:
|
subject
|
Email subject.
TYPE:
|
body
|
Email message body content.
TYPE:
|
mimetype
|
Email message body content type (default 'plain').
TYPE:
|
attachment_path
|
Path to the attachment file.
TYPE:
|
Returns: MIMEMultipart: Email message created.
Source code in dadosfera/services/email_sender/email_sender.py
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 |
|
attach_file
attach_file(msg, attachment_path)
Attaches a file to the email message.
PARAMETER | DESCRIPTION |
---|---|
msg
|
Email message.
TYPE:
|
attachment_path
|
Path to the attachment file.
TYPE:
|
Source code in dadosfera/services/email_sender/email_sender.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
send_email
send_email(to_email, message)
Sends an email message using SMTP server.
PARAMETER | DESCRIPTION |
---|---|
to_email
|
Recipient's email(s).
TYPE:
|
message
|
Email message.
TYPE:
|
Source code in dadosfera/services/email_sender/email_sender.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|