换成你的qq帐号或者163邮箱帐号
具体怎么做,我忘了,你自己看看我以前写的代码吧。。。我也是闲的
# coding: utf-8
import os
from datetime import datetime
from flask.ext.moment import Moment
from flask.ext.script import Manager
from flask import Flask,render_template,session,redirect,url_for,flash
from flask.ext.bootstrap import Bootstrap
from flask.ext.wtf import Form
from wtforms import StringField,SubmitField
from wtforms.validators import Required
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Shell
from flask.ext.migrate import Migrate,MigrateCommand
from flask.ext.mail import Mail
from flask.ext.mail import Message
basedir = os.path.abspath(os.path.dirname(__file__))
app=Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']=
'sqlite:///'+os.path.join(basedir,'data.sqlite')
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN']=True
app.config['SECRET_KEY']='hard to guess string'
app.config['MAIL_SERVER']='smtp.qq.com'
app.config['MAIL_PORT']=465
#app.config['DEBUG']=True
app.config['MAIL_USE_TLS']=False
app.config['MAIL_USE_SSL']=True
app.config['MAIL_USERNAME']='[email protected]'
app.config['MAIL_PASSWORD']='xxxxxx'(好像是SMTP,我把自己的隐藏了)
app.config['FLASKY_MAIL_SUBJECT_PREFIX']='[FLASKY]'
app.config['FLASKY_MAIL_SENDER']='Flasky Admin<[email protected]>'
app.config['FLASKY_ADMIN']=os.environ.get('FLASKY_ADMIN')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…