Sending Mails Made Easy
Project description
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:
-
Qmail uses emailsender437@gmail.com as a default account if you don't enter your own email.
-
Perfect for testing
USAGE
Installation
-
Python 3.8 or newer environment recommended
-
Install Qmail
Open up terminal and type
pip install Qmail
For mac
pip3 install Qmail
SMTP
Create Qmail Smtp class.
-
import the Qmail library
import Qmail
-
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
-
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)' )
-
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
-
import the Qmail library
import Qmail
-
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
-
import the Qmail library
import Qmail
-
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
-
import the Qmail.OTP library
from Qmail import OTP
-
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
-
import the Qmail.OTP library
from Qmail import OTP
-
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
- smtplib
- ssl
- random
- math
- Qmail
Thanks For Using My Module
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f350800a58ad32a6b169a369fef61f5a61b84cd3c1fa70374af3c44a59b1bd9 |
|
MD5 | 0c81aeaae099b616c9d390c8f7c01bce |
|
BLAKE2b-256 | ba70c1021b4fe10e04ab53222a938365bbf99712a283e6d1f7884eecd95a1b5d |