imap

IMAP GMAIL getting folder list problem

蹲街弑〆低调 提交于 2019-12-11 23:51:55
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 8 years ago . I am working on IMAP and trying to get the list of folders in my Gmail account. I am able to get it working with Yahoo Mail, but not Gmail. Here's my code: byte[] commandBytes = System.Text.Encoding.ASCII.GetBytes((("$ XLIST \"\" \"*\" \r\n")).ToCharArray()); I had tried LIST as well, but it's also not working. What am I doing wrong? 回答1: You cannot have a

Automatic acquisition of POP3/IMAP/SMTP parameters for an email server

南笙酒味 提交于 2019-12-11 23:22:59
问题 I'm trying to find a way in order to retrieve POP3/IMAP/SMTP parameters for a specific e-mail server. What I would like to do is the following: given any e-mail address, such as xxxx@server.com/it/etc, retrieve the correct POP3/IMAP settings in order to retrieve e-mails from that account and SMTP settings in order to send e-mails from that account. Practically, what I search is a way to retrieve the server parameters needed in order to send and receive emails, that is, I search the same

PHP delete old messages from IMAP mail account

天涯浪子 提交于 2019-12-11 22:44:31
问题 I am trying to access a IMAP webmail account in order to delete old messages using php. The script I have so far is: <?php $del = new DateTime(); $del->modify('-1 month'); $mbox = imap_open("{imap.test.com:993/imap/ssl}INBOX", "username", "password") or die("can't connect: " . imap_last_error()); $MC = imap_check($mbox); // Fetch an overview for all messages in INBOX $result = imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0); foreach ($result as $overview) { $date = $overview->date; $date =

IMAP, Microsoft Exchange, Searching Emails

大城市里の小女人 提交于 2019-12-11 20:38:33
问题 I am currently working on a web app, that is essentially a CRM. The client wants to be able to do all his day to day business tasks through the CRM. The major point he wishes to have is the ability to send and receive emails from within his web app. Is this possible using IMAP? Could I get message threads etc? The other major point is that if he views a client profile he would like to see the email threads for that client. Is that possible? Can I retrieve emails based on the recipient or

Open local mbox mail archive with imap_open() in PHP

邮差的信 提交于 2019-12-11 19:30:41
问题 I'm attempting to read an mbox email archive exported from another server locally, via file access, but for whatever reason everything I've tried fails. Is there some magical trick to parse a local file and access it with PHP's built-in IMAP functionality? 回答1: You should be able to use PHP's built-in IMAP functionality. Have you tried something like this: function openLocal($file_path) { $mbox = imap_open("$file_path",'',''); if (!mbox) { $errorMsg = imap_last_error(); // do something with

IMAP Client Sync local messages Server?

不想你离开。 提交于 2019-12-11 19:29:26
问题 What's the best general technique for creating an IMAP client and keeping its local message store in sync with the server? I guess I'm looking for the right way to figure out what's changed in an IMAP folder on the server since the last time I checked, and download those changes, to persist them to my local database... This would include messages no longer in the folder (deleted or moved), new messages, and changed messages... I guess new messages is easy, I can grab the highest UID i have

Can you use conditionals in IMAP_SEARCH from the PHP IMAP library?

↘锁芯ラ 提交于 2019-12-11 16:40:11
问题 I haven't been able to find anything while exploring the code and searching for documentation. Has anyone been able to achieve this? http://php.net/manual/en/function.imap-search.php 回答1: No, you can't. (Hard to believe, right?) PHP uses Mark Crispin's c-client library under the hood to do its IMAP work. In the c-client library, there is a deprecated method mail_criteria in mail.c that translates an IMAP search string to a c-client search program. mail_criteria has been deprecated for the

Is it possible to thread pool IMAP connections?

夙愿已清 提交于 2019-12-11 14:11:22
问题 From what I understand IMAP requires a connection per each user. I'm writing an IMAP client (currently just gmail) that supports many (100s, 1000s maybe 10000s+) users at a time. Obviously cutting down the number of open connections would be great. I'm wondering if it's possible to use thread pooling on my side to connect to gmail via IMAP or if that simply isn't supported by the IMAP protocol. 回答1: IMAP typically uses SSL over TCP/IP. And a TCP/IP connection will need to be maintained per

Javamail event listener not getting any events

ε祈祈猫儿з 提交于 2019-12-11 12:37:45
问题 I coded an IMAP handler and an event listener as I understood it should be done, but I don't see any events firing, despite filling up the inbox with new emails. What could be my problem? I set up the store to idle until someone closes the mailbox: public void run() { boolean logged = false; synchronized (emailListener) { while (!isCancelled) { try { if (isListening) { throw new EtlSystemException( null, "Disallowed attempt to " + "start email listener - listening status already set", null,

IMAP is not working in PHP

♀尐吖头ヾ 提交于 2019-12-11 11:35:47
问题 The following code is not working. I get this error: 500 - Internal server error :: Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX Here is the code: $hostname = 'xxxx'; $username = 'xxxx'; $password = 'xxxx'; $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); $emails = imap_search($inbox,'ALL'); if($emails) { $output = ''; rsort($emails); foreach($emails as $email_number) { $overview =