Python3 Mail client
Project description
PyMail - mail client by python
Requirements`
email 4.0+
Usage`
Send Simple Message`
Attributes -> message, subject, to
mail = EMail(login='your@mail.login', password='yourmailpassword')
mail.mail(message="Hello", subject='Simple Html Message', to='mail@to.recive')
mail.stop()
Send Message Bomber (many messages) `
Attributes -> message*, subject*, to, count
mail = EMail(login='your@mail.login', password='yourmailpassword')
mail.bomb(message="Hello", subject='Simple Html Message', to='mail@to.recive', count=10) # count message recive the client
mail.stop()
Send html Message `
Attributes -> html*, subject*, to
mail = EMail(login='your@mail.login', password='yourmailpassword')
mail.html(html="<h1>Hello</h1>", subject='Simple Html Message', to='mail@to.recive')
mail.stop()
Send Image Message `
Attributes -> message*, subject*, to, path
mail = EMail(login='your@mail.login', password='yourmailpassword')
mail.image(path="hello.jpg", message="Hello World", subject='Simple Html Message', to='mail@to.recive')
mail.stop()
Note` for send message from file you can use read_file method
Example`
mail = EMail(login='your@mail.login', password='yourmailpassword')
mail.mail(message=mail.read_mail("Message.txt"), subject='Simple Html Message', to='mail@to.recive')
mail.stop()
Read Mails`
Example num 1
from mail import Reciver # only Reciver
# Load method Params`
# login => your email
# password => your password
# imap => imap server
r = Reciver("your@mail.login", 'yourmailpassword')
# Load method Params`
# folder => default "inbox" > folder from where load mails
# enc => default "(RFC822)" > encription of message ids
# count => defult 1 > messages to load
print(r.load())
Example num 2
from mail import Email
mail = Email("your@mail.login", 'yourmailpassword')
print(mail.reader.load())
Example 3 - Download attachs
from mail import Reciver
r = Reciver("mishamartun@mail.ru", 'M20042005')
for mail in r.load():
print("="*100)
print(mail['from'])
print(mail['message'])
for i in mail['attach']:
r.download_attachment(*i)
constructors
Arguments -> login[str] - password[str] - imap[tuple] - smtp[tuple] - reader[bool]
load()
Arguments -> folder[str] - enc[str] - count[int]
download_attachment()
Arguments -> part[obj] - content_disposition[obj] - folder[str]
count()
Arguments -> folder[obj]
Reciver
Arguments -> login[str] - password[str] - imap[tuple]
read()
Arguments -> folder[str] - enc[str] - count[int]
download()
Arguments -> part[obj] - content_disposition[obj] - folder[str]
count()
Arguments -> folder[obj]
mail()
Arguments -> message[str], subject[str], to[str]
image()
Arguments -> message[str], subject[str], to[str], path[str]
bomb()
Arguments -> message[str], subject[str], to[str], count[int]
html_message()
Arguments -> html[str], subject[str], to[str]
read_file()
Arguments -> path[str] - encoding[str]
stop()
Arguments -> [EMPTY]
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 Distributions
Built Distribution
File details
Details for the file AMail-0.1-py3-none-any.whl
.
File metadata
- Download URL: AMail-0.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 322e8eabf4feae71f92f4f5f2af1175f1489c54aec6014ac9547ec5e2848b6b3 |
|
MD5 | 16e604cab95714e2221db0bc0866482c |
|
BLAKE2b-256 | 8fc65e287f570521a6fa685dc4ee7e90aed01c4d41743875fc36792839d954f0 |