简体   繁体   English

如何使用php从特定的电子邮件地址获取邮件信息并将标头信息存储到mysql数据库中

[英]how to use php to get mail info from a specific email address and store header info into a mysql database

I want to find out if there is a way to read email info from a certain address with php, and take the From,To,Subject,Date and store them into a mysql database. 我想找出是否有一种方法可以使用php从某个地址读取电子邮件信息,并采用From,To,Subject,Date并将它们存储到mysql数据库中。 I would like to either check for new mails on a button click for example, or ideally when an email is received to get somehow the new mail and store the info i want. 我想例如在单击按钮时检查是否有新邮件,或者理想情况下是在收到电子邮件以某种方式获得新邮件并存储所需信息时。

I hope i have explained my question well.. 我希望我已经很好地解释了我的问题。

it depends if the site is yours. 这取决于该网站是否属于您。 if you are the owner of it or the coder it is possible to save it while sending simply by collection the info and saving it and only then send the email. 如果您是它的所有者或编码员,则可以在收集信息的同时进行保存,只需收集信息并保存,然后再发送电子邮件即可。

but if the email service itself is not yours (for example Gmail, Yahoo etc..) you cannot save the data with php. 但是,如果电子邮件服务本身不属于您(例如Gmail,Yahoo等),则无法使用php保存数据。 creating a program that reads emails could be possible, but i myself havent gone far enough to make a program that reads sites. 创建一个可以读取电子邮件的程序是可能的,但是我本人还没有走出足够长的距离来编写一个读取站点的程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM