from smtplib import SMTP
from typing import Any, Iterator, List, Optional, Type, Union

from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import EmailMessage


class EmailBackend(BaseEmailBackend):
    fail_silently: bool
    host: Any = ...
    port: Any = ...
    username: Any = ...
    password: Any = ...
    use_tls: Any = ...
    use_ssl: Any = ...
    timeout: Any = ...
    ssl_keyfile: Any = ...
    ssl_certfile: Any = ...
    connection: Any = ...
    def __init__(
        self,
        host: None = ...,
        port: None = ...,
        username: Optional[str] = ...,
        password: Optional[str] = ...,
        use_tls: Optional[bool] = ...,
        fail_silently: bool = ...,
        use_ssl: Optional[bool] = ...,
        timeout: None = ...,
        ssl_keyfile: Optional[str] = ...,
        ssl_certfile: Optional[str] = ...,
        **kwargs: Any
    ) -> None: ...
    @property
    def connection_class(self) -> Type[SMTP]: ...
    def open(self) -> Optional[bool]: ...
    def close(self) -> None: ...
    def send_messages(
        self, email_messages: Union[Iterator[Any], List[EmailMessage]]
    ) -> int: ...
