doumu2172 2011-03-02 20:04 采纳率: 0%
浏览 48
已采纳

在php中检查未读邮件

I'm trying to implement a check new mail function to my page. By this I mean a script that checks the mail, if there exists unread mails it will notify the user "You got one unread mail".

Is this possible?

Thanks in advance

I managed to get it to work as long as the users emails and passwords are stored as plain text in the database.

I'm using a query to retrieve email and password of a user from my database ($email) and ($password)

The code:

$mbox = imap_open("{imap.domain.com:143/novalidate-cert}INBOX", "$email", "$password");

The only problem is that the email passwords for my users are stored as md5 hash.

How can I handle this with imap_open?

Thanks

  • 写回答

5条回答 默认 最新

  • drl92080 2011-03-02 20:05
    关注

    It is possible, if you implement an IMAP (or POP3) client in your PHP script. When you open your page, PHP would connect to the mail server and check for new messages. To achieve this, PHP would need your username/password and server address/port. Hence, this information will have to be stored on the server.

    The example given at http://lv.php.net/imap_mailboxmsginfo will give you some more hints.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看