Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
pydantic-extra documentation
pydantic-extra documentation

Content:

  • Quick start
  • Libraries to connect to
  • API pydantic-extra
    • smtp
    • _db (base classes for db and adb)
    • db
    • adb
    • enums
  • Changelog
  • Contribution
    • Tools
  • GitHub
Back to top
View this page

smtp¶

class pydantic_extra.smtp.MailServer¶

Bases: pydantic.BaseModel

Configuration for connecting to an SMTP server

smtp_host: str¶
smtp_port: int = 465¶
smtp_ssl: bool = True¶
smtp_login: str¶
smtp_password: SecretStr¶
from_addr: str¶

Default smtp_login.

connect() → smtplib.SMTP¶

Returns an object smtplib.SMTP with the specified address

login(smtp: smtplib.SMTP) → None¶

Performs authorization for SMTP connection

Next
_db (base classes for db and adb)
Previous
API pydantic-extra
Copyright © 2026, Ярыкин Евгений
Made with Sphinx and @pradyunsg's Furo
On this page
  • smtp
    • MailServer
      • MailServer.smtp_host
      • MailServer.smtp_port
      • MailServer.smtp_ssl
      • MailServer.smtp_login
      • MailServer.smtp_password
      • MailServer.from_addr
      • MailServer.connect()
      • MailServer.login()