在CakePHP中接收/检索电子邮件 [英] Receiving / retrieving email in CakePHP

查看:161
本文介绍了在CakePHP中接收/检索电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个小型培训中心开发一个基本但高度定制的CRM,该培训中心能够存储学生记录并向他们发送电子邮件。我在之后使用SwiftMailer这个极好的教程在CakePHP中完成发送部分。



当然,学生有时会回复电子邮件,我想检索他们我的CRM并将它们与学生记录一起存储。



但是,我找不到一个单独的引用。我尝试了以下Google搜索:接收电子邮件cakephp,检索电子邮件cakephp甚至电子邮件客户端cakephp,但所有这些查询都给出与发送相关的结果,而不是



最后,我将我的搜索范围扩大到了非蛋糕解决方案,并发现有人推荐一个名为ezComponents的库。它似乎没有任何积极的发展大约一年,但它包括一个电子邮件接收类,这正是我想要的。不幸的是,我不知道如何将它添加到CakePHP和唯一的帖子我已经能够在整个网上找到的事情并没有完全进入更多的细节。这当然不是一个关于在CakePHP上使用ezComponent的分步教程,就像我上面提到的SwiftMailer教程一样。



我还在Google Code上找到一个名为php-imap它看起来像它会做的工作,但是,我没有丝毫如何让它工作在像SwiftMailer这样的蛋糕很愉快。



我意识到,可能需要学习如何封装类在Cake自己使用,但我问这个问题的第一个机会,已经有一个蛋糕友好的解决方案,我只是没有实现: - ) / p>

Joseph

解决方案

感谢大家的答案,



基本上,在插件的帮助下,我可以在数据库中设置邮件服务器.php作为数据源,然后编写一个模型和控制器与它进行交互。



下面是我发现的示例: https://github.com/kvz/cakephp-emails-plugin



修改:repo已弃用,现在可在 https://github.com/kvz/deprecated/tree/cakephp-emails-plugin


I am developing a basic yet highly customized CRM for a small training centre which has the ability to store student records and also send emails to them. I'm using SwiftMailer following this excellent tutorial in CakePHP to accomplish the sending part.

Of course, students are sometimes going to reply to emails and I'd like to retrieve them within my CRM and store them along with the student record.

However, I cannot find a single reference to doing this. I've tried the following Google searches: "receiving email cakephp" , "retrieving email cakephp" and even "email client cakephp" but all of these queries give results relating to sending mail rather than receiving it -- very frustrating!

Finally, I broadened my search to non-cake solutions and found someone recommending a library called ezComponents. It doesn't seem to have had any active development for about a year, but it includes an email receiving class which is exactly what I want. Unfortunately, I have no idea how to add this to CakePHP and the only post I've been able to find on the entire web on the matter doesn't exactly go into much detail. It's certainly not a step-by-step tutorial on using ezComponents on CakePHP like the SwiftMailer tutorial I mentioned above.

I also found a class on Google Code called php-imap which looks like it would do the job but, again, I haven't the slightest clue how to get it working happily in Cake like SwiftMailer is.

I realize that I may have to learn how to package classes for use in Cake by myself but I'm asking this question first on the off-chance that there is already a Cake-friendly solution to this problem that I just haven't realized :-)

Joseph

解决方案

Thanks to everyone for your answers, but I've been doing some more searching and it looks like the solution is actually incredibly simple.

Basically, with the help of a plugin, I can set up the mail server in databases.php as a datasource and then write a Model and Controller to interact with it.

Here's the example I found: https://github.com/kvz/cakephp-emails-plugin

Edit: the repo has been deprecated and is now available at https://github.com/kvz/deprecated/tree/cakephp-emails-plugin

这篇关于在CakePHP中接收/检索电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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