Skip to content

Mail

Mail module for dost. This module contains functions for sending emails.

Examples:

>>> from dost import mail
>>> mail.send_gmail_using_app_password(gmail_username='abcd',gmail_app_password='abcd',to_email_id='abcd@abc.com',subject='abcd',message='abcd',attachment_path='abc.pdf')

This module contains the following functions:

  • send_gmail_using_app_password(gmail_username, gmail_app_password, to_email_id, subject, message, attachment_path): Send an email using a gmail account and an app password.

send_gmail_using_app_password(gmail_username, gmail_app_password, to_email_id, subject, message, attachment_path='')

Send email using gmail app password

Parameters:

Name Type Description Default
gmail_username str

Gmail username

required
gmail_app_password str

Gmail app password

required
to_email_id str || list

To email id

required
subject str

Subject of the email

required
message str

Message of the email

required
attachment_path str || WindowsPath || list

Attachment path

''

Examples:

>>> mail.send_gmail_using_app_password(gmail_username='abcd',gmail_app_password='abcd',to_email_id='abcd@abc.com',subject='abcd',message='abcd',attachment_path='abc.pdf')