
    	h              0          d Z ddlZddlZddlZddlmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZmZ ddlmZ dZddddd	ddddded
dddddddddde
ej        j        ej        j        eef         dee         dee
eee         f                  deee                  deee                  dee         dee         dee
eef                  dee
eef                  dee         dee	eef                  dee         dedee         dedee         dee         deej                 dee         d ee         d!eej                 d"e	eeef         ef         f,d#ZdS )$z
Main public API.
    N)DictOptionalSequenceTupleUnioncast   )SMTPResponse)DEFAULT_TIMEOUTSMTP)SocketPathType)send	localhostFT)sender
recipientsmail_optionsrcpt_optionshostnameportusernamepasswordlocal_hostnamesource_addresstimeoutuse_tls	start_tlsvalidate_certsclient_cert
client_keytls_contextcert_bundlesocket_pathsockmessager   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   returnc                 K   t          | t          j        j        t          j        j        f          s"|st          d          |st          d          t          t          |          }t          t          t          t          t                   f         |          }t          di d|d|d|	d|
d|d|d	|d
|d|d|d|d|d|d|d|d|}|4 d{V  t          | t          j        j        t          j        j        f          r!|                    | ||||           d{V }n |                    ||| ||           d{V }	 ddd          d{V  n# 1 d{V swxY w Y   |S )a  
    Send an email message. On await, connects to the SMTP server using the details
    provided, sends the message, then disconnects.

    :param message:  Message text. Either an :py:class:`email.message.EmailMessage`
        object, ``str`` or ``bytes``. If an :py:class:`email.message.EmailMessage`
        object is provided, sender and recipients set in the message headers will be
        used, unless overridden by the respective keyword arguments.
    :keyword sender:  From email address. Not required if an
        :py:class:`email.message.EmailMessage` object is provided for the `message`
        argument.
    :keyword recipients: Recipient email addresses. Not required if an
        :py:class:`email.message.EmailMessage` object is provided for the `message`
        argument.
    :keyword hostname:  Server name (or IP) to connect to. Defaults to "localhost".
    :keyword port: Server port. Defaults ``465`` if ``use_tls`` is ``True``,
        ``587`` if ``start_tls`` is ``True``, or ``25`` otherwise.
    :keyword username:  Username to login as after connect.
    :keyword password:  Password for login after connect.
    :keyword local_hostname: The hostname of the client.  If specified, used as the
        FQDN of the local host in the HELO/EHLO command. Otherwise, the result of
        :func:`socket.getfqdn`. **Note that getfqdn will block the event loop.**
    :keyword source_address: Takes a 2-tuple (host, port) for the socket to bind to
        as its source address before connecting. If the host is '' and port is 0,
        the OS default behavior will be used.
    :keyword timeout: Default timeout value for the connection, in seconds.
        Defaults to 60.
    :keyword use_tls: If True, make the initial connection to the server
        over TLS/SSL. Mutually exclusive with ``start_tls``; if the server uses
        STARTTLS, ``use_tls`` should be ``False``.
    :keyword start_tls: Flag to initiate a STARTTLS upgrade on connect.
        If ``None`` (the default), upgrade will be initiated if supported by the
        server.
        If ``True``, and upgrade will be initiated regardless of server support.
        If ``False``, no upgrade will occur.
        Mutually exclusive with ``use_tls``.
    :keyword validate_certs: Determines if server certificates are
        validated. Defaults to ``True``.
    :keyword client_cert: Path to client side certificate, for TLS.
    :keyword client_key: Path to client side key, for TLS.
    :keyword tls_context: An existing :py:class:`ssl.SSLContext`, for TLS.
        Mutually exclusive with ``client_cert``/``client_key``.
    :keyword cert_bundle: Path to certificate bundle, for TLS verification.
    :keyword socket_path: Path to a Unix domain socket. Not compatible with
        hostname or port. Accepts str, bytes, or a pathlike object.
    :keyword sock: An existing, connected socket object. If given, none of
        hostname, port, or socket_path should be provided.

    :raises ValueError: required arguments missing or mutually exclusive options
        provided
    z.Recipients must be provided with raw messages.z*Sender must be provided with raw messages.r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r   r   N)r   r   r   r   )r   r    )
isinstanceemailr$   EmailMessageMessage
ValueErrorr   strr   r   r   send_messagesendmail)r$   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   clientresults                          [/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/aiosmtplib/api.pyr   r      s     X g :EM<QRSS K 	OMNNN 	KIJJJ#vFeC#./<<J   T &~ &~	
   ) &~  K :  K  K  K T   !F&         g :EM<QRSS 	!..%)) /        FF "??)) +        F                           $ Ms   A2E##
E-0E-)__doc__email.messager)   socketssltypingr   r   r   r   r   r   responser
   smtpr   r   r   __all__r$   r*   r+   r-   bytesintfloatbool
SSLContextr   r'       r2   <module>rA      s         



 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? " " " " " " ' ' ' ' ' ' ' ' " " " " " "  !6:,0,0),0,0$(04. $!% $,0!%,0$(/z z z5=-u}/Dc5PQz SM	z
 sHSM123z 8C=)z 8C=)z smz 3-z uS%Z()z uS%Z()z SMz U38_-z e_z z  ~!z" #z$ #%z& 'z( #.))z* #+z, .)-z. 6=
!/z0 4\!"C'(1z z z z z zr@   