I sent an email from the Sakura server using flask-mail, which is an extension of the Python framework Flask.
Python 3.4.2 Flask==0.10.1 Flask-Mail==0.9.1 And Sakura rental server standard plan mail server
import
script.py
from flask_mail import Mail, Message
Next, the following was added in the form of updating the original config.
script.py
app.config.update(
MAIL_SERVER='[Domain name].sakura.ne.jp',
MAIL_PORT=587,
MAIL_USE_TLS=True,
MAIL_USERNAME = 'USERNAME',
MAIL_PASSWORD = 'PASSWORD'
)
USERNAME is [Name given when making with Sakura's control panel] @ [Domain name] .sakura.ne.jp PASSWORD is the one made with Sakura's control panel Was used respectively.
After that, I could do it according to the official website. https://pythonhosted.org/Flask-Mail/
Recommended Posts