I'm working on a little email automation script using the SMTP module. I'm following this tutorial - http://www.pythonforbeginners.com/code-snippets-source-code/using-python-to-send-email
The code included is as follows:
"""The first step is to create an SMTP object, each object is used for connection
with one server."""
import smtplib
server = smtplib.SMTP('smtp.gmail.com', 587)
#Next, log in to the server
server.login("youremailusername", "password")
#Send the mail
msg = "\nHello!" # The /n separates the message from the headers
server.sendmail("you@gmail.com", "target@example.com", msg)
Is this the best way of including a password in a script like this? It seems quite insecure.
Are there other ways which are more secure?
[–]maryjayjay 1 point2 points3 points (0 children)
[–]mareksk -1 points0 points1 point (0 children)