Back to Prefect

credentials

docs/integrations/prefect-email/api-ref/prefect_email-credentials.mdx

3.6.30.dev32.0 KB
Original Source

prefect_email.credentials

Credential classes used to perform authenticated interactions with email services

Classes

SMTPType <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-email/prefect_email/credentials.py#L17" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Protocols used to secure email transmissions.

SMTPServer <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-email/prefect_email/credentials.py#L27" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Server used to send email.

EmailServerCredentials <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-email/prefect_email/credentials.py#L72" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Block used to manage generic email server authentication. It is recommended you use a Google App Password if you use Gmail.

Attributes:

  • username: The username to use for authentication to the server. Unnecessary if SMTP login is not required.
  • password: The password to use for authentication to the server. Unnecessary if SMTP login is not required.
  • smtp_server: Either the hostname of the SMTP server, or one of the keys from the built-in SMTPServer Enum members, like "gmail".
  • smtp_type: Either "SSL", "STARTTLS", or "INSECURE".
  • smtp_port: If provided, overrides the smtp_type's default port number.
  • verify: If False, SSL certificates will not be verified. Default to True.

Methods:

get_server <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-email/prefect_email/credentials.py#L159" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
get_server(self) -> SMTP

Gets an authenticated SMTP server.

Returns:

  • An authenticated SMTP server.