imap

PHP Displaying unread mail count

心不动则不痛 提交于 2019-12-17 16:02:15
问题 I am using php imap class. In my box I have a lot of mail, but with this script I would retrieve only the unreaded mail. How can I do it? if ($mbox=imap_open( "{" . $mailserver . ":" . $port . "}INBOX", $user, $pass )) { echo "Connected\n"; } else { exit ("Can't connect: " . imap_last_error() ."\n"); echo "FAIL!\n"; }; if ($hdr = imap_check($mbox)) { $msgCount = $hdr->Nmsgs; echo "Ci sono ".$msgCount." mail"; } else { echo "Failed to get mail"; } If I do $overview=imap_fetch_overview($mbox,"1

面试官常问的Nginx的几个问题

怎甘沉沦 提交于 2019-12-17 14:55:57
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.什么是Nginx? Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器 Nginx是一款轻量级的Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器 目前使用的最多的web服务器或者代理服务器,像淘宝、新浪、网易、迅雷等都在使用 2.为什么要用Nginx? 优点: 跨平台、配置简单 非阻塞、高并发连接:处理2-3万并发连接数,官方监测能支持5万并发 内存消耗小:开启10个nginx才占150M内存 成本低廉:开源 内置的健康检查功能:如果有一个服务器宕机,会做一个健康检查,再发送的请求就不会发送到宕机的服务器了。重新将请求提交到其他的节点上。 节省宽带:支持GZIP压缩,可以添加浏览器本地缓存 稳定性高:宕机的概率非常小 master/worker结构:一个master进程,生成一个或者多个worker进程 接收用户请求是异步的:浏览器将请求发送到nginx服务器,它先将用户请求全部接收下来,再一次性发送给后端web服务器,极大减轻了web服务器的压力 一边接收web服务器的返回数据,一边发送给浏览器客户端 网络依赖性比较低,只要ping通就可以负载均衡 可以有多台nginx服务器 事件驱动:通信机制采用epoll模型 3

linux php7.2开启pdo等扩展

人盡茶涼 提交于 2019-12-17 11:47:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> yum install php72w-mysql php72w-gd libjpeg* php72w-imap php72w-ldap php72w-odbc php72w-pear php72w-xml php72w-xmlrpc php72w-mbstring php72w-mcrypt php72w-bcmath php72w-mhash libmcrypt 安装完成后重启Apache:service httpd restart php7所有扩展 p.s. php70w.x86_64即php7 php72w.x86_64即php7.2 yum install php70w.x86_64 php70w-bcmath.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-dba.x86_64 php70w-devel.x86_64 php70w-embedded.x86_64 php70w-enchant.x86_64 php70w-fpm.x86_64 php70w-gd.x86_64 php70w-imap.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64

Retrieve UnRead Emails from Gmail - JavaMail API + IMAP

六月ゝ 毕业季﹏ 提交于 2019-12-17 10:34:12
问题 Now I have created a code to retrieve unread email and read its body and then we can store or do whatever we want to do. It is completely working but the problem is that it giving me only the body for the first mail and for the second it gives the body with html tags. I'm using JavaMail API... How can I do?? Thanks in advance. Best regards, Ali package pack1; //import the necessary classes import java.io.IOException; import java.util.Properties; import javax.mail.Flags; import javax.mail

Retrieve UnRead Emails from Gmail - JavaMail API + IMAP

给你一囗甜甜゛ 提交于 2019-12-17 10:34:09
问题 Now I have created a code to retrieve unread email and read its body and then we can store or do whatever we want to do. It is completely working but the problem is that it giving me only the body for the first mail and for the second it gives the body with html tags. I'm using JavaMail API... How can I do?? Thanks in advance. Best regards, Ali package pack1; //import the necessary classes import java.io.IOException; import java.util.Properties; import javax.mail.Flags; import javax.mail

Fatal error: Call to undefined function imap_open() in PHP

回眸只為那壹抹淺笑 提交于 2019-12-17 07:27:22
问题 I am trying to access my gmail account through my localhost. However, I am getting the response: Fatal error: Call to undefined function imap_open() This is my code: $hostname = '{imap.gmail.com:993/imap/ssl}INBOX'; $username = 'myid@gmail.com'; $password = 'mypassword'; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' .imap_last_error()); 回答1: Simple enough, the IMAP extension is not activated in your PHP installation. It is not

Fatal error: Call to undefined function imap_open() in PHP

巧了我就是萌 提交于 2019-12-17 07:27:11
问题 I am trying to access my gmail account through my localhost. However, I am getting the response: Fatal error: Call to undefined function imap_open() This is my code: $hostname = '{imap.gmail.com:993/imap/ssl}INBOX'; $username = 'myid@gmail.com'; $password = 'mypassword'; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' .imap_last_error()); 回答1: Simple enough, the IMAP extension is not activated in your PHP installation. It is not

Reading emails from Gmail in C#

感情迁移 提交于 2019-12-17 06:30:10
问题 I am trying to read emails from Gmail. I have tried every API / open source project I can find, and can not get any of them working. Does anyone have a sample of working code that will allow me to authenticate and download emails from a Gmail account? Final working version posted below: https://stackoverflow.com/a/19570553/550198 回答1: Using the library from: https://github.com/pmengal/MailSystem.NET Here is my complete code sample: Email Repository using System.Collections.Generic; using

Getting mail from GMail into Java application using IMAP

橙三吉。 提交于 2019-12-17 02:54:08
问题 I want to access messages in GMail from a Java application using JavaMail and IMAP. Why am I getting a SocketTimeoutException ? Here is my code: Properties props = System.getProperties(); props.setProperty("mail.imap.host", "imap.gmail.com"); props.setProperty("mail.imap.port", "993"); props.setProperty("mail.imap.connectiontimeout", "5000"); props.setProperty("mail.imap.timeout", "5000"); try { Session session = Session.getDefaultInstance(props, new MyAuthenticator()); URLName urlName = new

How can receive emails in Java based system preferably with spring?

别说谁变了你拦得住时间么 提交于 2019-12-14 03:41:51
问题 I have looked up Google and Spring documentation but can not find any thing on receiving emails. I need to build a client (kind of not fully blown client) that can receive emails from POP3 and IMAP. I am already using Spring in the project so preference is Spring. Lots of links point to James but while it does look like a good project does not provide enough documentation and I am not even sure it does what I am after i.e just a small client that is able to to receive emails. 回答1: Spring