imap

Javamail to receive emails; whats wrong?

放肆的年华 提交于 2020-01-17 04:47:26
问题 I am trying to create a very simple (text based for now) email app for receiving emails. So far i have used this code : http://www.javaer.org/j2ee/3-javamail/8-javamail-connecting-gmail-using-pop3-with-ssl The problem is that i when i run this code i am able to get the new emails, only for once. For example if i have a new message in inbox the first time i will this code it will show it but then it wont. Also it seems that i cant see the body contents of the emails which is strange. I was

imap_sort limit the number of results?

末鹿安然 提交于 2020-01-17 03:00:48
问题 I am using PHP with IMAP. I need to retrieve the 20 most new emails from a folder. I user imap_sort to sort by date, but the problem is that for a large folder with 700 and more emails it takes ages. Is there a way i can use PHP IMAP to sort messages by date and bring only the latest 20 emails? Maybe to use imap_search ? Here is my code: $start_from = params::cleanDefault($_GET, 'start_from', 0); $limit = params::cleanDefault($_GET, 'limit', 20); $sort_by = params::cleanDefault($_GET, 'sort

IMAP message gets UnicodeDecodeError 'utf-8' codec can't decode

一曲冷凌霜 提交于 2020-01-16 19:34:31
问题 After 5 hours of trying, time to get some help. Sifted through all the stackoverflow questions related to this but couldn't find the answer. The code is a gmail parser - works for most emails but some emails cause the UnicodeDecodeError. The problem is "raw_email.decode('utf-8')" but changing it (see comments) causes a different problem down below. # Source: https://stackoverflow.com/questions/7314942/python-imaplib-to-get-gmail-inbox-subjects-titles-and-sender-name import datetime import

IMAP message gets UnicodeDecodeError 'utf-8' codec can't decode

不打扰是莪最后的温柔 提交于 2020-01-16 19:34:07
问题 After 5 hours of trying, time to get some help. Sifted through all the stackoverflow questions related to this but couldn't find the answer. The code is a gmail parser - works for most emails but some emails cause the UnicodeDecodeError. The problem is "raw_email.decode('utf-8')" but changing it (see comments) causes a different problem down below. # Source: https://stackoverflow.com/questions/7314942/python-imaplib-to-get-gmail-inbox-subjects-titles-and-sender-name import datetime import

IMAP enabled, but functions undefined?

做~自己de王妃 提交于 2020-01-16 06:25:46
问题 One of our email parsing scripts is having a problem using imap functions: Fatal error: Call to undefined function imap_open() IMAP is definitely enabled, it was compiled with php and shows up in the phpinfo() and when doing get_loaded_extensions() or extension_loaded("imap") Is there any reason why these functions may not be accessible? IMAP version is 2007e and PHP is 5.3. Edit 1: This is running on a mac server (OSX 10.5.7) the script using the imap function is in /var/***/ I tried putting

IMAP enabled, but functions undefined?

这一生的挚爱 提交于 2020-01-16 06:25:40
问题 One of our email parsing scripts is having a problem using imap functions: Fatal error: Call to undefined function imap_open() IMAP is definitely enabled, it was compiled with php and shows up in the phpinfo() and when doing get_loaded_extensions() or extension_loaded("imap") Is there any reason why these functions may not be accessible? IMAP version is 2007e and PHP is 5.3. Edit 1: This is running on a mac server (OSX 10.5.7) the script using the imap function is in /var/***/ I tried putting

How to save the attachments of a email in php?

筅森魡賤 提交于 2020-01-15 03:25:31
问题 I am retrieving the emails and then parsing into the database. But the problem is i am able to retrieve the email but the attachment part is also shown on the browser.I need to save this attachment part to the some location .The format of attachment is text/plain. here is my code <?php $inbox=imap_open("{xyz.com:995/pop3/ssl/novalidate-cert}INBOX", "username", "password"); $count = imap_num_msg($inbox); for($i = 1; $i <= 1; $i++) { $raw_body = imap_body($inbox, $i); echo $raw_body; imap

JavaMail, IMAP, performance with large number of folders

杀马特。学长 韩版系。学妹 提交于 2020-01-14 15:04:08
问题 We are developing a java based mail client for IMAP accounts and use latest java mail api (1.5.6). Our customers have mail accounts with more than 400 folders. Users perform check mails on folders and iterating on each folder and getting new messages for example, folder.getMessagesByUid(lastStoredUID, UIDFolder.LastUID) or getting count of unread messages takes too much time beacuse huge number of folders. (We have to iterate on 400 folders) To increase the performance we used paralel working

Connect to gmail (using imap and javamail) with encrypted password

被刻印的时光 ゝ 提交于 2020-01-14 13:52:05
问题 I'm trying to connect to gmail using a simple java program (like this one). But my question is: Is there a way to do this with encrypted password and not the real password, for security reasons of course!! something like how we do in java-Oracle db ? 回答1: By default, the only authentication mechanism for IMAP is the LOGIN command, which takes an unencrypted username and password. You can add an encryption layer on top of it, either by connecting via IMAPs or starting a TLS layer via the

How to download attachment from gmail in C# using IMAP?

本秂侑毒 提交于 2020-01-14 13:51:46
问题 I have using a console app for downloading document from the mail using IMAP Service. I use "S22.Imap" assembly in application for the IMAP. I got the all mails contains attached files in IEnumerable. How could I download these Files? using (ImapClient client = new ImapClient(hostname, 993, username, password, AuthMethod.Login, true)) { IEnumerable<uint> uids = client.Search(SearchCondition.Subject("Attachments")); IEnumerable<MailMessage> messages = client.GetMessages(uids, (Bodypart part) =