email-headers

Create custom mail header field

梦想的初衷 提交于 2019-12-25 04:55:35
问题 I'm making a program which sends invoices to registered users as PDF attachment. Each invoice is identified by a GUID. In some circumstances I want to be able to find programmatically the GUID from mail without reading PDF file. Can I use mail header field to include invoice GUID, or it is a bad practice and mail header fields are not for this purpose? 回答1: It is common practice to use "X-HeaderName" to designate non-standardized headers. 来源: https://stackoverflow.com/questions/2115342/create

Setting email headers with perl

十年热恋 提交于 2019-12-24 06:36:03
问题 I'm trying to set some email headers when sending email in perl. I have the following code, however the Content-Type and X-Priority get sent in the body of the message. The following is my code. my $sendmail = "| /usr/sbin/sendmail -t"; open(MAIL,$sendmail) or die("Unable to open sendmail. $!"); print MAIL "Reply-to: $reply\n"; print MAIL "From: $from\n"; print MAIL "To: $to\n"; print MAIL "Subject: $subject\n\n"; print MAIL "Content-Type: text/plain\n"; print MAIL "X-Priority: 1\n"; print

What are the valid characters for a Mime Multipart message ContentId “CID:”?

丶灬走出姿态 提交于 2019-12-23 19:15:31
问题 From reading the RFC it appears that CID can/must only contain characters from the same set as those permissable by a regular URI. Is this correct. Im asking because I wish to writeup a simple helper that takes a CIDs prefix and adds a counter when generating CID for mime multitypes attachments. 回答1: The Content-ID value is required to be in the form of an RFC-822 addr-spec (user@domain). Since an addr-spec may contain characters not allowed in a URL, those characters are hex-encoded when

Custom “reply to” email header in Woocommerce New Order email notification

无人久伴 提交于 2019-12-19 09:39:19
问题 I'm looking to filter the email headers of the new order form in woocommerce. I'm trying to replace the customer email address with the main site admin email address. We need to do this because Gmail is flagging new orders as spam because the from address is not the same as the reply to address. The function below works partially: add_filter( 'woocommerce_email_headers', 'woo_add_reply_to_wc_admin_new_order', 10, 3 ); function woo_add_reply_to_wc_admin_new_order( $headers = '', $id = '',

Custom Email Headers in Laravel 4

 ̄綄美尐妖づ 提交于 2019-12-18 16:10:33
问题 I can't seem to locate the method within the Laravel 4 docs/Email API where I can add custom headers to an email. For example: Mail::send('emails.welcome', $data, function($message) { $message->to('foo@example.com', 'John Smith')->subject('Welcome!'); $message->headers('X-Tags', 'tag1 tag2 tag3'); }); Does anyone know how this can be done? 回答1: As far as I know there's no way to add custom headers without reaching in to Swift Mailer. Try something like this. $message->getSwiftMessage()-

What do X-headers in mails stand for?

房东的猫 提交于 2019-12-18 05:47:14
问题 I'm wondering what all X- headers in e-mails stand for. Are they really just a custom and everyone can make them up? Are they documented somewhere? I've quickly browsed RFC 5322. It does not seem to mention anything about custom headers. When or by whom were they introduced? Thank you for shedding some light in that field :) 回答1: RFC822 ("Standard for the Format of ARPA Internet Text Messages") specified in sections 4.7.4 and 4.7.5 that headers beginning with "X-" would not ever be part of

How to cause sent emails to appear threaded in GMail recipient's view with Message-ID, In-Reply-To and References

本小妞迷上赌 提交于 2019-12-18 03:32:22
问题 I've read some great online resources like http://www.jwz.org/doc/threading.html, and it seems that any email is send with a Message-ID header, then any replies to it include In-Reply-To naming that ID and Refences which can name a list of parent message id's, and email clients use this information to construct threads when viewing a list of emails in threaded view. My question is: Can a series of emails be sent to a recipient with faked headers, to make them appear in a thread without the

Given an email as raw text, how can I send it using PHP?

最后都变了- 提交于 2019-12-17 13:26:39
问题 I've got a PHP script that my mail server is piping emails to via STDIN. Is there a straightforward/non-convoluted way to take a raw email string and send/forward/relay it to a specific email address? I hesitate to use PHP's mail() or Pear::Mail because, as far as I can tell, I can't just pass along the raw email. I'd have to parse the headers, thereby running the risk of stripping or altering the original email's contents. What would be the recommended way to do this with minimal "molesting"

Python - email header decoding UTF-8

心不动则不痛 提交于 2019-12-17 05:01:30
问题 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 -

HTML Email sent via PHP treated as spam in Gmail

泪湿孤枕 提交于 2019-12-14 03:53:19
问题 I have the following php script which loads a html template from a .txt file on my server and uses str_replace to populate the template with the Email content before sending the email. At first I tried hardcoding my Webmail address on my server into the 'to' field of my mailer_send function which worked fine. The Email template displayed perfectly. However, when I then tried sending it to a Gmail account, it was marked as junk and the HTML was just displayed as plain text. Does anyone know