Coder Social home page Coder Social logo

al-taie / quick-mailer Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 3.0 249 KB

This Module help you to send fast Email And you can attach image, audio, and other files easily.๐ŸŒธ

Home Page: https://al-taie.github.io/quick-mailer

License: MIT License

Python 100.00%
smtp-mail smtp-library python python3 email email-sender gmail-smtp gmail outlook hotmail

quick-mailer's Introduction

image

Star Badge GitHub last commit Lines of code Downloads Downloads Downloads Rate this package Verified on Openbase

Description

This Module help you to send fast Email. ๐ŸŒธ

And you can attach image, audio, and other files easily.

The Module support Gmail And Microsoft right now, but in the nearly future will support other mail services.

Auth

see this: How to login after disable less secure apps?

Installation:

pip install quick-mailer

-->> pypi Link

Usage:

Send Message

from mailer import Mailer

mail = Mailer(email='[email protected]',
              password='your_password')

mail.send(receiver='[email protected]',  # Email From Any service Provider
          no_reply='[email protected]', # Redirect receiver to another email when try to reply.
          subject='TEST',
          message='HI, This Message From Python :)')

Parameters

receiver: Email Address as String or List.                [Required]
cc: Email Address as String or List.  (Carbon Copy)       [Optional]
bcc: Email Address as String or List. (Blind Carbon Copy) [Optional]
sender_name: Set Sender name.                             [Optional]
receiver_name: Set receiver name.                         [Optional]
no_reply: Set Another Email To Reply                      [Optional]
subject: Message Title.                                   [Optional]
message: Your Message.                                    [Optional]
image: Image File Name.               (Image Path)        [Optional]
audio: Audio File Name.               (Audio Path)        [Optional]
file: File Name.                      (Any File Path)     [Optional]

Check Send Status

# Using (status) Attribute 
print(mail.status)

# Example For One Receiver:
if mail.status:
  pass
else:
  pass
  
 # Note:
 # IF You Put List Emails Receivers
 # Variable Will Return Dictionary Results.
 
 # IF You Allowed Repeat
 # The Attribute Will provide Results List.

Send Multi Files

mail.send(receiver='[email protected]',  # Email From Any service Provider
          subject='TEST',
          message='HI, This Message From Python :)',
          image='img.jpg',      # Image File Path
          audio='sound.mp3',    # Audio File Path
          file='file.zip')      # Any File Path

Settings Method

mail.settings(repeat=1,             # To Repeat Sending
              sleep=0,              # To Sleep After Send Each Message
              provider=mail.GMAIL,  # Set Maill Service
              multi=False)          # Default False, If You Set True
                                    # Message Will Sent 4 Each Email Alone
                                    # Else Will Sent To All Together

Send Multi Emails

# One By One:
mail.settings(multi=False)

# In Same Message:
mail.settings(multi=True)

mail.send(receiver=['[email protected]', '[email protected]'],
          subject='TEST',
          message='HI, This Message From Python :)')

Counter Variables

# CC Receivers Count
print('CC count:', mail.count_cc)

# BCC Receivers Count
print('BCC count:', mail.count_bcc)

# Receivers Count
print('Receivers count:', mail.count_rec)

# Messages Count
print('Messages count:', mail.count_msg)

Example Function

from mailer import example

example()

About Method

# You Can Use (mail.about) Method for more info.
mail.about()

Changelogs

2022.2.22 update:

  • Add (sender name & receiver name) feature.

2022.2.10 update:

  • Fix issue #3 TypeError on python < 3.10

2022.2.2 update:

  • Support Html Message
  • Fix issue #1 TypeError on python < 3.10

Follow Me on Instagram: @9_Tay. ๐ŸŒธ

Thank You :) ๐ŸŒธ

quick-mailer's People

Contributors

al-taie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

quick-mailer's Issues

TypeError: unsupported operand type

Describe the bug
TypeError: unsupported operand type(s) for |: 'type' and 'type'

To Reproduce
Steps to reproduce the behavior:
from mailer import Mailer

mail = Mailer(email='sender', password='password')
mail.settings(provider=mail.MICROSOFT)
mail.send(receiver='receiver', subject='TEST', message='From Python')

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: win 10
  • Browser chrome
  • Version 97.0.4692.71

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.