SMTP (Simple Mail Transfer Protocol) is a communication protocol for electronic mail transmission. As an Internet standard, SMTP was first defined in 1982 by RFC 821, and updated in 2008 by RFC 5321 to Extended SMTP additions, which is the protocol variety in widespread use today. Mail servers and other message transfer agents use SMTP to send and receive mail messages. Proprietary systems such as Microsoft Exchange and IBM Notes and webmail systems such as Outlook.com, Gmail and Yahoo! Mail may use non-standard protocols internally, but all use SMTP when sending to or receiving email from outside their own systems. SMTP servers commonly use the Transmission Control Protocol on port number 25.
- port 587 should only be used for submissions [This port, coupled with TLS encryption] (i.e., mail client to mail server),
- port 25 should only be used for relaying (i.e., mail server to mail server communications), and
- port 465 should no longer be used at all.
- Request:
$ sudo apt-get install putty putty-tools
$ sudo yum install putty
$ putty -raw smtp.gmail.com 587 (or putty -raw ssl0.ovh.net 587)
> HELO client
> [HELO client – Host (Gmail) - Secure(TLS) – Port(587)]
putty
Host name: smtp.gmail.com
Port: 587
Select: 'raw' in Connection type
> HELO client
- Response:
! 250 smtp.gmail.com at your service
$ sudo apt-get install openssl
# or
$ sudo yum install openssl
$ openssl s_client -starttls smtp -connect ssl0.ovh.net:587
$ openssl s_client -connect ssl0.ovh.net:465
$ sudo apt-get install telnet
# or
$ sudo yum install telnet
$ telnet smtp.domain.com 25
MIME (Multipurpose Internet Mail Extensions) is an Internet standard that extends the format of email messages to support text in character sets other than ASCII, as well as attachments of audio, video, images, and application programs. Message bodies may consist of multiple parts, and header information may be specified in non-ASCII character sets. Email messages with MIME formatting are typically transmitted with standard protocols, such as the Simple Mail Transfer Protocol (SMTP), the Post Office Protocol (POP), and the Internet Message Access Protocol (IMAP).
In computer science, Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding.
Each Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.
Common to all binary-to-text encoding schemes, Base64 is designed to carry data stored in binary formats across channels that only reliably support text content. Base64 is particularly prevalent on the World Wide Web where its uses include the ability to embed image files or other binary assets inside textual assets such as HTML and CSS files.
name,email,grade
John Doe,john.doe@gmail.com,B+
Mortadha DAHMANI,mortadha.dahmani@gmail.com,A
+ bmFtZSxlbWFpbCxncmFkZQ0KSm9obiBEb2Usam9obi5kb2VAZ21haWwuY29tLEIrDQpNb3J0YWRoYSBEQUhNQU5JLG1vcnRhZGhhLmRhaG1hbmlAZ21haWwuY29tLEE=
-
Python 2.7 or Python 3.4 and newer
-
If running on Windows: Windows 7 or newer
- Change your Less secure app access On
This installs a package that can be used from Python:
import email, smtplib, ssl, os
pySerial can be installed from PyPI:
python -m pip install smtplib
Using the python
/python3
executable of the desired version (2.7/3.x).
Developers also may be interested to get the source archive, because it contains examples, tests and the this documentation. By using PyPI, you will be using the latest stable version.
If this project help you, you can give me a tip ;)
- This version has been created by: Mortadha DAHMANI
- Initial Release : 08 April 2020
- PySendMail-Attachements is distributed under the LGPL version 3 license.