Skip to main content

Make Send Mail Easy In Python 3

Project description

EasyMail Class

Make Send Mail Easy In Python 3

try:
    #Import EasyMail
    import easyemail
except(ModuleNotFoundError,ImportError):
    #Use Folder Version
    from . import easymail

1銆丼end An Plain Email

def sendPlain(client,
              receivers,
              text="",
              subject="",
              sender_name=None,
              receivers_name=None,
              encoding="utf-8"
              ):
    '''
    Send Plain Email
    :param client:EMAIL CLIENT(SMTPClient)
    :param receivers:the Receivers(str or list or tuple or frozenset)
    :param text:Email HTML Body
    :param subject:Email Subject
    :param sender_name:Email Sender's Name(From,Default value is sender Email Address)
    :param receivers_name:Email Receivers' Name(To,Default value is 1st Receivers)
    :param encoding:Text,Subject,sender_name,receivers_name 's encoding,default is 'utf-8'
    :return:Hasn't return
    '''
    pass

You can use this futc. to send an email,like this

from easymail import *
client=SMTPClient("smtp.abc.com")#Your Email Server
client.login("def@abc.com","123456")#Your Email And Your Password
sendPlain(client,["ghi@abc.com"],"The Subject","HelloWorld","ghi","def","utf-8")

The HTML Futc.:

def sendHTML(client:SMTPClient,
              receivers,
              text="",
              subject="",
              sender_name=None,
              receivers_name=None,
              encoding="utf-8"
              ):
    '''
    Send Plain Email
    :param client:EMAIL CLIENT(SMTPClient)
    :param receivers:the Receivers(str or list or tuple or frozenset)
    :param text:Email Body
    :param subject:Email Subject
    :param sender_name:Email Sender's Name(From,Default value is sender Email Address)
    :param receivers_name:Email Receivers' Name(To,Default value is 1st Receivers)
    :param encoding:Text,Subject,sender_name,receivers_name 's encoding,default is 'utf-8'
    :return:Hasn't return
    
    '''
    pass

Html is similar to the function of sending plain text, so I won't repeat it here.

send Any Text:

def sendAnyText(client:SMTPClient,
              receivers,
                typeof="plain",
              text="",
              subject="",
              sender_name=None,
              receivers_name=None,
              encoding="utf-8"
              ):
    '''
    Send Plain Email
    :param client:EMAIL CLIENT(SMTPClient)
    :param receivers:the Receivers(str or list or tuple or frozenset)
    :param typeof:Mail Body Type(default:plain)
    :param text:Email Body
    :param subject:Email Subject
    :param sender_name:Email Sender's Name(From,Default value is sender Email Address)
    :param receivers_name:Email Receivers' Name(To,Default value is 1st Receivers)
    :param encoding:Text,Subject,sender_name,receivers_name 's encoding,default is 'utf-8'
    :return:Hasn't return
    '''
    pass

It's similar too!

Project details


Download files

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

Files for easymailsender, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size easymailsender-1.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page