Python3 only
$ pip install messages
>>> from messages import Email
>>> msg = 'Hello,\n\tBuy more Bitcoin!'
>>> m = Email(
from_='me@here.com',
server='smtp.here.com',
port=465,
to='you@there.com',
auth='p@ssw0rd',
body=msg,
attachments=['./file1.txt', '~/Documents/file2.pdf'],
profile='myProfileName',
save=True # save user params for easier invocations later
)
>>>
>>> m.send()
Message sent...
Using the save=True keyword arg in the example above saves the _from__, server, port, and auth params, under the profile name myProfileName so you don't have include them in future calls, like below:
>>> from messages import Email
>>> msg = 'Hello,\n\tBuy more Bitcoin!'
>>> m = Email(
to='you@there.com',
body=msg,
attachments=['./file1.txt', '~/Documents/file2.pdf'],
profile='myProfileName',
)
>>>
>>> m.send()
Message sent...
$ messages email myProfileName 'Hello,\n\tBuy more Bitcoin!' \
--to you@there.com \
--attach ./file.txt \
--attach ~/Documents/file2.pdf \
Message sent...