
    i                     8    d dl Z d dlmZ d dlmZ  G d d      Zy)    N)MIMEText)MIMEMultipartc                   &    e Zd Zededefd       Zy)
MailHelperemail_nguoi_nhandatac                 &   d}d}d}d}|j                  dd      }|j                  dd      }|j                  d	d
      }t        d      }	d|	d<   d| d|	d<   | |	d<   d| d| d| d}
|	j                  t        |
d             	 t	        j
                  ||      }|j                          |j                  ||       |j                  || |	j                                |j                          y# t        $ r}t        d|        Y d }~yd }~ww xY w)Nzsmtp.gmail.comiK  zdarkevilhorse@gmail.comqumkwewfcorwdrppusernameu   Người dùngpasswordu   Không có mật khẩunoteu/   Hãy đổi mật khẩu sau khi đăng nhập.alternativezMAT KHAU MOI CUA BANSubjectzVet System Account <>FromTouB   
        <html>
            <body>
                <h2>Xin chào, ut   </h2>
                <p>Bạn được cấp mật khẩu mới:</p>
                <p><b style='font-size:20px;'>z</b></p>
                <p>u   </p>
                <br>
                <i>Email được gửi tự động từ hệ thống FastAPI. Vui lòng không trả lời.</i>
            </body>
        </html>
        htmlTu   Lỗi gửi mail: F)getr   attachr   smtplibSMTPstarttlsloginsendmail	as_stringquit	Exceptionprint)r   r   	smtp_host	smtp_port	smtp_user	smtp_passr   new_passr   messagehtml_contentserveres                7/var/www/pod-logistic/pod-api/controller/mail_helper.pysend_new_password_emailz"MailHelper.send_new_password_email   s5    %		-	&	 88J(8988J(ABxx QR  .3	01=(  !)z *//7j 96 	 	xf56		\\)Y7FOOLLI.OOI'79J9J9LMKKM 	&qc*+	s   A)C/ /	D8DDN)__name__
__module____qualname__staticmethodstrdictr)        r(   r   r      s"    +# +T + +r1   r   )r   email.mime.textr   email.mime.multipartr   r   r0   r1   r(   <module>r4      s     $ .- -r1   