cpl_core.mailing
cpl_core.mailing.email
- class cpl_core.mailing.email.EMail(header: Optional[list[str]] = None, subject: Optional[str] = None, body: Optional[str] = None, transceiver: Optional[str] = None, receiver: Optional[list[str]] = None)
Bases:
object
Represents an email
- header: list[
str
] Header of the E-Mail
- subject:
str
Subject of the E-Mail
- body:
str
Body of the E-Mail
- transceiver:
str
Transceiver of the E-Mail
- receiver: list[
str
] Receiver of the E-Mail
- add_header(header: str)
Adds header
- header:
str
The header of the E-Mail
- header:
- add_receiver(receiver: str)
Adds receiver
- receiver:
str
The receiver of the E-Mail
- receiver:
- property body: str
- static check_mail(address: str) bool
Checks if an email is valid
- address:
str
The address to check
Result if E-Mail is valid or not
- address:
- get_content(transceiver: str)
Returns the mail as string
- transceiver:
str
The transceiver of the E-Mail
E-Mail as string
- transceiver:
- property header: str
- property header_list: list[str]
- property receiver: str
- property receiver_list: list[str]
- property subject: str
- property transceiver: str
- header: list[
cpl_core.mailing.email_client_abc
- class cpl_core.mailing.email_client_abc.EMailClientABC
Bases:
abc.ABC
ABC of
cpl_core.mailing.email_client_service.EMailClient
- abstract connect()
Connects to server
- abstract send_mail(email: cpl_core.mailing.email.EMail)
Sends email
- email:
cpl_core.mailing.email.EMail
Object of the E-Mail to send
- email:
cpl_core.mailing.email_client_service
- class cpl_core.mailing.email_client_service.EMailClient(environment: cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC, logger: cpl_core.logging.logger_abc.LoggerABC, mail_settings: cpl_core.mailing.email_client_settings.EMailClientSettings)
Bases:
cpl_core.mailing.email_client_abc.EMailClientABC
Service to send emails
- environment:
cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC
Environment of the application
- logger:
cpl_core.logging.logger_abc.LoggerABC
The logger to use
- mail_settings:
cpl_core.mailing.email_client_settings.EMailClientSettings
Settings for mailing
- connect()
Connects to server
- create()
Creates connection
- login()
Login to server
- send_mail(email: cpl_core.mailing.email.EMail)
Sends email
- email:
cpl_core.mailing.email.EMail
Object of the E-Mail to send
- email:
- environment:
cpl_core.mailing.email_client_settings
- class cpl_core.mailing.email_client_settings.EMailClientSettings
Bases:
cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
Representation of mailing settings
- property credentials: str
- from_dict(settings: dict)
Converts attributes to dict
settings:
dict
- property host: str
- property port: int
- property user_name: str