Skip to content

Mail

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

Examples:

>>> from autopylot import mail
>>> mail.send_gmail_using_app_password(gmail_username='abcd',gmail_app_password='abcd',to_email_id='[email protected]',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_via_desktop_outlook(to_email_id, subject, message, attachment_path): Send an email via desktop outlook.

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

''

Returns:

Type Description
None

None

Examples:

>>> mail.send_gmail_using_app_password(gmail_username='abcd',gmail_app_password='abcd',to_email_id='[email protected]',subject='abcd',message='abcd',attachment_path='abc.pdf')

send_via_desktop_outlook(to_email_id, subject='', message='', attachment_path='')

Sends an email via desktop outlook.

Parameters:

Name Type Description Default
to_email_id str || list

Email id of the recipient.

required
subject str

Subject of the email.

''
message str

Message of the email.

''
attachment_path str || Windows Path || list

Path of the attachment.

''

Returns:

Type Description
None

None

Examples:

>>> send_via_desktop_outlook(to_email_id='[email protected]', subject='Subject', message='Message', attachment_path='C:\Users\abc\Desktop\file.txt')