在python shell中发送电子邮件,但是却怎么也发送不成功

在看书《flask web开发》到60页的时候,在python shell中发送电子邮件,但是却怎么也发送不成功。一开始使用的是163邮箱,我把163邮箱的smtp/pop各种服务都开了,结果还是不行。然后换成sina邮箱开启smtp/pop,改了服务器地址以及端口,也是失败。搜索了下网易使用邮箱客户端授权码当做邮箱密码也不行,然后直接把邮箱账户密码写进代码也不行,有朋友写到这里的时候是怎么解决的
设置环境变量那边错了
你别设置环境变量,直接把用户名密码放在代码里可以发的.

sina可以成功,163可以成功 邮箱就算开启smtp/pop

Pycharm 2016.1 发布了

http://blog.jetbrains.com/pycharm/2016/03/announcing-general-availability-of-pycharm-2016-1/

Python-related improvements:

Python 2 and Python 3 type hinting and compatibility inspection
Docker Compose and Docker container settings
Tox Support
Improved Support for Django Forms
Significant debugger improvements
Enhanced support for IPython Notebook

Platform enhancements:

Git Rebase and Rename
Git Worktree Support
By-word changes highlighting in Diff Viewer
Enhanced Database Tools
Local Terminal Improvements

Web development improvements:

Improvements in ECMAScript 6 and TypeScript support
Major enhancements in Angular 2 support
Support for debugging asynchronous client-side code
Running and debugging Node.js apps on remote hosts
And even more

http://www.jetbrains.com/pycharm/download

 

别人给我的建议 谢谢

Flask 和 web.py你都该学学。最好从web.py开始入门,跟着官网的中文教程走。
web.py可以让你快速上手,你说的Flask书如果是安道翻译的那本Flask狗书,个人建议如果看着累还是立马看web.py官网文档。
Flask是个利器,那本狗书是个好东西,浅显易懂,但是很多内容虽然使用起来很方便但是也会发现很奇怪,譬如模板那部分提到的后台flash函数。。。Flask为了使用者的方便,功能封装的有点过度了。

nine day learning flask

cd flasky

source venv/bin/activate

python hello.py

OK

 

http://127.0.0.1:5000/      OK

 

 

2016.3.14
templates/base.html
{% extends "bootstrap/base.html" %}

{% block title %}Flasky{% endblock %}

{% block navbar %}
<div class="navbar navbar-inverse" role="navigation">
<div class="container">

<div class="button" class="navbar-toggle"
data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>