gmail-imap

'str' object has no attribute 'message_from_bytes'

妖精的绣舞 提交于 2019-12-24 06:58:22
问题 I have a piece of code to get emails from messages from my inbox (gmail). Getting emails work correct when I print email_from but I would like to do some operation on data split name and email etc. but then code broke after print first loop step and I got the error: Traceback (most recent call last): File "C:\Users\loc\Desktop\extract_gmail.py", line 24, in <module> email_message_raw = email.message_from_bytes(data[0][1]) AttributeError: 'str' object has no attribute 'message_from_bytes' Can

TCP Client through multithreading in C#

那年仲夏 提交于 2019-12-24 02:12:53
问题 I am connecting to Gmail account using TCP client for reading emails. It returns SslStream for the TCP connection. It works fine for single thread environment but performance is very poor in terms of speed. I need to optimize the project so that its speed can be increased. I have implemented multithreading which increases the speeed but application gets hang at some point. Is it thread safe to use TCP connection (global member)? OR Can I create multiple TCP connections and pass to the thread

Gmail IMAP with PHP?

北战南征 提交于 2019-12-23 19:27:50
问题 I'm trying to connect to my Gmail account in PHP via IMAP but I always get an error that says it can't open stream. I've tried lots of different things to fix this but I've had no luck. By the way, I'm using 000webhost.com to host my website and they say that they support IMAP. Here's my code: $server="{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX"; $inbox = imap_open($server,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); For the $username and $password, I

Receiving email using Imap through SSL connection using javax.mail

倾然丶 夕夏残阳落幕 提交于 2019-12-22 12:28:12
问题 I want to receive emails using imap trough secure connection. I implemented it using using javax.mail api. But there are different server configurations. As I found 1) store = session.getStore(imaps); store.connect(imap.gmail.com, username, password) Which make 'isSSL' true and use port 993 which is secure port to connect in javax.mail. Following configuration also prove secure connection through 993 port. 2) properties.put("mail.imap.host", imap.gmail.com); properties.put("mail.imap.port",

Faster reading of inbox in Java

喜欢而已 提交于 2019-12-21 13:20:22
问题 I'd like to get a list of everyone who's ever been included on any message in my inbox. Right now I can use the javax mail API to connect via IMAP and download the messages: Folder folder = imapSslStore.getFolder("[Gmail]/All Mail"); folder.open(Folder.READ_ONLY); Message[] messages = folder.getMessages(); for(int i = 0; i < messages.length; i++) { // This causes the message to be lazily loaded and is slow String[] from = messages[i].getFrom(); } The line messages[i].getFrom() is slower than

Creating a Draft message in Gmail using the imaplib in Python

陌路散爱 提交于 2019-12-21 10:15:54
问题 I want to write a python module that sends data to a draft message in a G-mail account. I have written a script about two weeks ago that worked perfectly using imaplib. A simplified example of my module is below. (I have created a test email address for anyone to test this script on.) import imaplib import time conn = imaplib.IMAP4_SSL('imap.gmail.com', port = 993) conn.login('testpythoncreatedraft@gmail.com', '123456aaa') conn.select('[Gmail]/Drafts') conn.append("[Gmail]/Drafts", '',

Accessing attachments using gmail contextual gadgets

守給你的承諾、 提交于 2019-12-21 05:05:39
问题 I'd like to save an email, along with attachments, from Gmail (Google Apps) to another database for CRM-like functionality. However, according to the docs, "Extractors can not read email attachments". My question: Is it possible to somehow use some type of identifier from the email (such as EmailTimeExtractor) and use that to pull the attachments using IMAP? I'm not very familiar with contextual gadgets yet and just wanted to know if what I'm trying to do is possible before diving in too far!

imap: “Unable to create selectable TCP socket” when sending email from a C++ program

北战南征 提交于 2019-12-20 06:57:56
问题 I am trying to send an email from a C++ program using imap library. I have a Google Apps and a Gmail account to which I am sending the email. Whenever the program fails to send an email I am logging the errors to a file. I set my program to run in loop to send the emails. Sometimes, I don't get the emails and when I checked the log file I found out these errors being logged every time sending the email fails. Here is the part of the log file: [2012-04-23 11:04:34] ErrCode:1 ErrMsg:Unable to

Trouble opening gmail nnimap server in Emacs gnus on Windows

瘦欲@ 提交于 2019-12-20 03:00:21
问题 I'm trying to use Emacs gnus to connect to my gmail account. This is the relevant configuration code, taken mostly from here: (setq tls-program '("openssl s_client -CAfile C:/Users/GGustafson/gmail.crt -connect %h:%p -no_ssl2 -ign_eof")) (setq gnus-select-method '(nnimap "gmail" (nnimap-address "imap.gmail.com") (nnimap-server-port 993) (nnimap-stream ssl) (nnimap-authinfo-file "~/.authinfo"))) (setq message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials '(("smtp.gmail.com

Using IMAP () in PHP to get recent unread emails count

徘徊边缘 提交于 2019-12-18 17:26:06
问题 I am trying to get no. of recent unread mails from a gmail account.For this I have installed IMAP in my Ubuntu system and tried some PHP iMAP functions. Here are what i have tried till now. /* connect to gmail */ $hostname = '{imap.gmail.com:993/imap/ssl}INBOX'; $username = 'user@gmail.com'; $password = 'user_password'; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); Now I am stating all my attempts. NB - I have