将电子邮件发送到我的python / flask应用程序代码中的第一步是什么? [英] What is the first step to getting in e-mail into my python / flask app code?

查看:95
本文介绍了将电子邮件发送到我的python / flask应用程序代码中的第一步是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何使一个直接与电子邮件进行交互的网络应用程序。像你会发送到something@myapp.com,应用程序会将它分开,并确定它们是谁,如果他们在数据库中,主题行等等。



任何人都可以让我开始正确的方向,如何获得电子邮件与我的瓶子应用程序代码?

解决方案

有几种方法可以采取:




  • 编写一些使用IMAP或POP来检索电子邮件并进行处理的代码。或者从crontab(或类似的东西)运行它,或者将它添加到烧瓶应用程序中,并通过一个请求一个魔术URL或设置一个定制定时器线程的crontab来触发它。

  • 配置您的MTA,通过将其提供给您写的程序(例如在Exim中,您可以使用管道运输)。在该程序中,您可以直接进行处理,也可以在烧瓶应用程序中进行处理。


I am researching what it would take to make a web app that would interact with e-mails directly. Like you would send to something@myapp.com and the app would tear it apart and determine who it's from, if they are in the DB, what is the subject line, etc.

I am working with/most familiar with python and flask.

Could anyone get me started in the right direction of how to get an e-mail to interface with my flask app code?

解决方案

There are several approach you can take:

  • write some code which uses IMAP or POP to retrieve emails and process them. Either run this from a crontab (or something similar) or add it to your flask app and trigger it in there, either through a crontab that requests a magic URL or setting up a custom timer thread.
  • configure your MTA to deliver email for something@myapp.com by feeding it to a program you write (for example in Exim you could use a pipe transport) . In that program you can either process it directly, or do something like POSTing it to your flask app.

这篇关于将电子邮件发送到我的python / flask应用程序代码中的第一步是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆