xia_mail_sender.sender.MailSender
- class xia_mail_sender.sender.MailSender
Bases:
object
General method to send mails
- __init__()
Methods
__init__
()get_sender_dict
(mail_adr)Get sender information from mail address
send_mail_plain
(sender, to, subject, content)Send a plain mail (txt or html without attachment)
Attributes
Mail address book
- address_book = {}
Mail address book
- classmethod get_sender_dict(mail_adr: str)
Get sender information from mail address
- Parameters
mail_adr (str) – Full Email address. Like “John Smith” <john.smith@x-i-a.com>
- Returns
name and email
- Return type
dict
- classmethod send_mail_plain(sender: str, to: list, subject: str, content: str)
Send a plain mail (txt or html without attachment)
- Parameters
sender (str) – sender could be a validated mail or sth in the address mail book
to (str) – to could be a validated mail list or sth in the address mail book
subject (str) – mail subject
content (str) – mail content