email-headers

python imaplib to get gmail inbox subjects titles and sender name

喜夏-厌秋 提交于 2019-11-27 09:47:43
问题 I'm using pythons imaplib to connect to my gmail account. I want to retrieve the top 15 messages (unread or read, it doesn't matter) and display just the subjects and sender name (or address) but don't know how to display the contents of the inbox. Here is my code so far (successful connection) import imaplib mail = imaplib.IMAP4_SSL('imap.gmail.com') mail.login('mygmail@gmail.com', 'somecrazypassword') mail.list() mail.select('inbox') #need to add some stuff in here mail.logout() I believe

Change the sender name php mail instead of sitename@hostname.com

岁酱吖の 提交于 2019-11-26 20:23:55
问题 I am trying to send email from my php : $to = 'it@7sisters.in'; $email_from = "info@7sisters.in"; $full_name = 'Suraj Hazarika'; $from_mail = $full_name.'<'.$email_from.'>'; $subject = "testing sender name"; $message = ""; $message .= ' <p><strong>This is only a test . Please do not reply.</strong><br /> '; $from = $from_mail; $headers = "" . "Reply-To:" . $from . "\r\n" . "X-Mailer: PHP/" . phpversion(); $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset

Python - email header decoding UTF-8

蹲街弑〆低调 提交于 2019-11-26 18:51:52
is there any Python module which helps to decode the various forms of encoded mail headers, mainly Subject, to simple - say - UTF-8 strings? Here are example Subject headers from mail files that I have: Subject: [ 201105311136 ]=?UTF-8?B?IMKnIDE2NSBBYnM=?=. 1 AO; Subject: [ 201105161048 ] GewSt:=?UTF-8?B?IFdlZ2ZhbGwgZGVyIFZvcmzDpHVmaWdrZWl0?= Subject: [ 201105191633 ] =?UTF-8?B?IERyZWltb25hdHNmcmlzdCBmw7xyIFZlcnBmbGVndW5nc21laHJhdWZ3ZW5kdW4=?= =?UTF-8?B?Z2VuIGVpbmVzIFNlZW1hbm5z?= text - encoded sting - text text - encoded string text - encoded string - encoded string Encodig could also be

Email from PHP has broken Subject header encoding

邮差的信 提交于 2019-11-26 15:52:21
My PHP script sends email to users and when the email arrives to their mailboxes, the subject line ( $subject ) has characters like a^£ added to the end of my subject text. This is obviously and encoding problem. The email message content itself is fine, just the subject line is broken. I have searched all over but can’t find how to encode my subject properly . This is my header. Notice that I’m using Content-Type with charset=utf-8 and Content-Transfer-Encoding: 8bit . //set all necessary headers $headers = "From: $sender_name<$from>\n"; $headers .= "Reply-To: $sender_name<$from>\n"; $headers

Should I use the Reply-To header when sending emails as a service to others?

吃可爱长大的小学妹 提交于 2019-11-26 14:59:46
问题 Suppose we have an application that acts as a middleman, allowing Company A to send reports to their customers. Company A --> Company B (me)--> Company A's customers After getting the report we send email notifications to the recipients, but they necessarily originate from our company notifications email address e.g. joe.bloggs@a.com --> notifications@b.com --> peter@c.com Now, customers tend to reply to those email notifications, wanting them to go back to whoever sent the report at Company