__init__.py 692 B

123456789101112131415161718192021222324252627282930
  1. from .sender import EmailSender
  2. gmail = EmailSender(
  3. host="smtp.gmail.com",
  4. port=587,
  5. )
  6. def send_email(*args, host:str, port:int, user_name:str=None, password:str=None, **kwargs):
  7. """Send email
  8. Parameters
  9. ----------
  10. host : str
  11. Address of the SMTP host
  12. port : int
  13. Port of the SMTP server
  14. user_name : str
  15. User to send the email with
  16. password : str
  17. Password of the user to send the email with
  18. **kwargs : dict
  19. See redmail.EmailSender.send
  20. """
  21. sender = EmailSender(
  22. host=host,
  23. port=port,
  24. user_name=user_name,
  25. password=password
  26. )
  27. return sender.send(*args, **kwargs)