V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
304464743
V2EX  ›  Python

通过 http 代理发送邮件

  •  
  •   304464743 · 2019-04-22 11:48:57 +08:00 · 2913 次点击
    这是一个创建于 1802 天前的主题,其中的信息可能已经有所发展或是发生改变。

    公司的生产和测试环境都是通过 squid 服务器代理上网的,这种情况下,如何使用 python 发送邮件? (不想在生产环境中再安装 socket 代理了)

    5 条回复    2019-04-24 11:08:14 +08:00
    binux
        1
    binux  
       2019-04-22 11:53:53 +08:00
    你确定你们的代理没把 smtp 的端口都封了?
    commad
        2
    commad  
       2019-04-22 14:08:37 +08:00
    也只能用 connect 方法了
    Northxw
        3
    Northxw  
       2019-04-22 16:57:35 +08:00
    lieh222
        4
    lieh222  
       2019-04-23 08:57:42 +08:00
    模拟登录页面客户端发,比如登录 mail.qq.com
    jeadong
        5
    jeadong  
       2019-04-24 11:08:14 +08:00
    import smtplib
    from email.mime.text import MIMEText
    from email.mime.multipart import MIMEMultipart
    from email import encoders

    这几个库试试看 我就用这些然后写了个 PY 定期晚上发文件给各个邮箱
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5442 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:37 · PVG 16:37 · LAX 01:37 · JFK 04:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.