Skip to main content

Sending Mails Made Easy

Project description

Qmail

In this documentation ๐Ÿ‘‡

Features

Qmail makes sending emails Quick and easy:

๐Ÿ“จ Email Smtp:

  • Supports all email providers supported with Python. (Defaulted at smtp.gmail.com)

  • Email Spam Bot

  • HTML, PLAIN, Attachments

๐Ÿ”‘ OTP Services:

  • OTP Msg class used with Email Smtp

  • OTP Generator (Alpha Numerical & Numerical)

  • 3 HTML Themes

๐Ÿ‘ค Email Addr That Anyone Can Use:

USAGE

Installation

  1. Python 3.8 or newer environment recommended

  2. Install Qmail

    Open up terminal and type

    
    pip install Qmail
    
    

    For mac

    
    pip3 install Qmail
    
    

SMTP

Create Qmail Smtp class.

  1. import the Qmail library

    import Qmail
    
  2. Create Qmail Class

    sender = Qmail.SMTP(\
    
        EMAIL='yourmail@yourdomain.com', # Default: emailsender437@gmail.com
    
    
    
        PASSWORD= 'Your App Password', # Default: emailsender437 pass
    
        
    
        smtp= "smtp.domain.com", # Ex: smtp.gmail.com, Default : smtp.gmail.com
    
    
    
        reciever_emails= ["Mail To send1", "Mail To Send2", 'etc.'],  # Emails that will be receiving mail.
    
    
    
        port='port to send email in', # Optional
    
    
    
        cc='cc email address', # Give this value if cc is needed in the email
    
    
    
        bcc= 'bcc email address', # Give this value if bcc is needed in the email
    
    )  
    

    SMTP Class Parameters In Detail๐Ÿ‘‡

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    EMAIL

    Your Email Goes Here

    Strings Are Only Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    PASSWORD

    The app password of the email you gave in EMAIL parameter.

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    smtp

    The SMTP server of your email's domain

    Ex: smtp.gmail.com for gmail.com domain

Strings ONLY Accepted

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### reciever_emails

#####

Emails of the people your sending to goes here

Ex: ['email1@gmail.com', 'email2@outlook.com', 'email3@yahoo.com']

Lists accepted __ONLY__

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### port *|Optional|*

#####

The Port Number goes here (for SSL connections)

Default: 465

3 Digit Integers __ONLY__ Accepted

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### cc *|Add this value if you want an email to be sent as CC|*

#####

CC Email goes here

Strings __ONLY__ accepted

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### bcc *|Add this value if you want an email to be sent as BCC|*

#####

BCC Email goes here

Strings __ONLY__ accepted

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



###

#### More Creation Examples

```python

import Qmail



sender = Qmail.SMTP(reciever_emails= ['email1@gmail.com']) # Create a default Qmail smtp server 



sender2 = Qmail.SMTP(\

    EMAIL='Your Mail Goes Here', 

    PASSWORD= "Your EMAIL'S app password goes here.", 

    reciever_emails=['receicermail@yourdomain.com'], 

    smtp= 'Your Emails Smtp Server



) # Create a Qmail smtp server with your email. 



```

Send Emails
  1. Invoke the send_mail function on Qmail SMTP class

    import Qmail
    
    
    
    sender = Qmail.SMTP('parameters ๐Ÿ‘†')
    
    
    
    # To send
    
    sender.send_mail(message= 'Any Qmail MSG Class. (OTP, MSG, HTML_MSG)' )
    
  2. Qmail Smtp class spammer

    import Qmail
    
    
    
    sender = Qmail.SMTP('parameters ๐Ÿ‘†')
    
    
    
    # To Spam
    
    sender.spam_mail(message= 'Any Qmail MSG Class. (OTP, MSG, HTML_MSG)', num = 10 )
    
    # num= ammount of mails to send (Integer ONLY)
    

Qmail Msg Class

Create Qmail MSG Class

  1. import the Qmail library

    import Qmail
    
  2. Create Qmail MSG Class

    message = Qmail.MSG(\
    
        subject= 'Subject Of Email',
    
        txt= 'txt in the email',
    
        attachments=['file1', 'file2'] # Add Attachment Filepaths here 
    
    )
    

    Qmail MSG class Parameters In Detail๐Ÿ‘‡

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    subject

    subject of the email goes here

    Strings Are Only Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    txt

    What you want to include in your email goes here

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    attachments

    Put filenames here if you want to add them into the email.

Strings ONLY Accepted for 1 file, Lists ONLY Accepted for mutiple

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### Once you create this you can add it to the send_mail and spam_mail functions.

Qmail Html Msg Class

Create Qmail HTML MSG Class

  1. import the Qmail library

    import Qmail
    
  2. Create Qmail HTML_MSG Class

    message = Qmail.HTML_MSG(\
    
        subject= 'Subject Of Email',
    
        html= '<h1>Enter Html Here</h1>',
    
        attachments=['file1', 'file2'] # Add Attachment Filepaths here 
    
    )
    

    Qmail HTML MSG class Parameters In Detail๐Ÿ‘‡

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    subject

    the subject of the email goes here

    Strings Are Only Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    html

    Html goes here

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    attachments

    Put filenames here if you want to add them to the email.

Strings ONLY Accepted for 1 file, Lists ONLY Accepted for mutiple

###### โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–



##### Once you create this you can add it to the send_mail and spam_mail functions.

Qmail Otp Services

Generate OTP

  1. import the Qmail.OTP library

    from Qmail import OTP
    
  2. generate OTP function

    otp = OTP.generateOTP(lenght=4, type='numeric')
    
    # generateOTP returns OTP as string
    
    
    
    #### Types ####
    
    ## numeric
    
    # ex: 198745
    
    
    
    ## alphanumeric
    
    # ex: YRjliMZLx4 
    

    generateOTP() Parameters In Detail๐Ÿ‘‡

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    lenght

    Lenght of OTP goes here

    Integers Are ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    type

    OTP type: numeric or alphanumeric

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
Create OTP MSG Class

  1. import the Qmail.OTP library

    from Qmail import OTP
    
  2. Create Qmail OTP_EMAIL Class

    from Qmail import OTP
    
    
    
    one_time_password = OTP.generateOTP(lenght=10, type='alphanumeric')
    
    NAME = 'Qmail'
    
    themes_available = ['simple', 'default', 'modern']
    
    
    
    message = OTP.OTP_EMAIL(subject='OTP MAIl', otp=one_time_password, brand_name=NAME, theme='default')
    

    Qmail HTML MSG class Parameters In Detail๐Ÿ‘‡

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    subject

    the subject of the email goes here

    Strings Are ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    otp

    OTP goes here

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    brand_name

    your companies name or project name goes here.

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    theme

    choose one of the 3 themes

    default, simple, modern

    Strings ONLY Accepted

    โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–โž–
    Once you create this you can add it to the send_mail and spam_mail functions.

Authors

Akmal Riyas

Modules Used

- email
- smtplib
- ssl
- random
- math
- Qmail

Thanks For Using My Module

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Qmail-0.0.1.tar.gz (12.0 kB view details)

Uploaded Source

File details

Details for the file Qmail-0.0.1.tar.gz.

File metadata

  • Download URL: Qmail-0.0.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for Qmail-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7f350800a58ad32a6b169a369fef61f5a61b84cd3c1fa70374af3c44a59b1bd9
MD5 0c81aeaae099b616c9d390c8f7c01bce
BLAKE2b-256 ba70c1021b4fe10e04ab53222a938365bbf99712a283e6d1f7884eecd95a1b5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page