email-headers

Set the Message-ID mail header in Rails3 / ActionMailer

佐手、 提交于 2020-01-20 21:45:30
问题 I would like to alter the Message-ID header that is in the header portion of an email sent from a Ruby on Rails v3 application using ActionMailer. I am using Sendmail on localhost for mail delivery. Do I configure this in Sendmail or ActionMailer? Where do I configure this (if it is ActionMailer): a file in config/ folder or a file in app/mailers/ folder? 回答1: Teddy's answer is good, except that if you actually want each message to have a different ID, you need to make the default a lambda.

How do i specify X-Headers for outgoing emails in Microsoft Outlook 2010

一曲冷凌霜 提交于 2020-01-13 06:15:23
问题 I need to include custom headers in my outgoing emails. I'm using Microsoft Outlook 2010 and SendGrid SMTP server. In particular, i want to specify a unique tracking ID on each mail using SendGrid's X-SMTPAPI header. My Approach: I am build an Outlook Add-In that will intercept outgoing emails and add the required headers Outlook.Application object has an ItemSend event that serves this purpose. How do i use Mail.PropertyAccessor.SetProperty to set the custom headers? I am unable to find the

send message through SMTP with guarantee ID

牧云@^-^@ 提交于 2020-01-04 06:09:26
问题 good day! sorry for so "clear" question, let me explain. In my "program", i'm sending some emails, through (for example) gmail SMTP server. Let's pretend that every email, which i've sent, contains some unique ID (generated by me) in header. Is there any chance, after retrieving that messages from gmail (for example, with python imaplib), i will get that unique ID (in header) again? thanks 回答1: In general, MTAs will preserve whatever message headers you introduce. Relaying MTAs are required

Serializing JSON tersely with a max line length

落花浮王杯 提交于 2020-01-03 19:57:36
问题 So I'm generating a potentially lengthy JSON string for use in Sendgrid's SMTP API. Because it is going as an SMTP header, it should have a maximum line length (recommended 72, but absolutely no longer than 1000). One naive solution is described in the documentation at the end of: http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/ They suggest doing this: $js =~ s/(.{1,72})(\s)/$1\n /g; But I don't like that because it could split inside a string where whitespace is

PHP Mail - Multiple or malformed newlines found

a 夏天 提交于 2020-01-03 17:42:28
问题 we upgraded our version of PHP and are now getting the error " Warning: mail(): Multiple or malformed newlines found in additional_header". I've created experimenting with different things but haven't gotten anything to work. I apologize as I'm not very familiar with how all of this works, so please bear with me. The objective (which worked in earlier versions) is to send an HTML based message (has , tags, etc) that includes a PDF attachment that exists on our server. If you can give me

Content-Type with charset only

喜欢而已 提交于 2020-01-02 08:16:48
问题 I came across this interesting header: Content-Type: charset=utf-8 Set HTTP header to UTF-8 using PHP The answerer says that this syntax is defined by RFC 2616, but I am not seeing it in the provided link. Is this valid syntax, and if so where specifically is this defined? 回答1: The production in RFC 2616 for the Content-Type header is this: Content-Type = "Content-Type" ":" media-type And the media-type production is this: media-type = type "/" subtype *( ";" parameter ) type = token subtype

How do I determine if an email is Base64 encoded?

江枫思渺然 提交于 2020-01-02 05:15:10
问题 I am having difficulty determining if the body of a text email message is base64 encoded. if it is then use this line of code; making use of jython 2.2.1 dirty=base64.decodestring(dirty) else continue as normal. This is the code I have atm. What line of code will allow me to extract this from the email: "Content-Transfer-Encoding: base64" import email, email.Message import base64 def _get_email_body(self): try: parts=self._email.get_payload() check=parts[0].get_content_type() if check=="text

Customizing email headers in WooCommerce email notifications

醉酒当歌 提交于 2020-01-01 19:51:50
问题 I am trying to write a filter that changes the reply-to address for WooCommerce email, dependent on the 'billing city' the order is made for. This works for WooCommerce emails, but doesn't seem to work for WooCommerce Advanced notifications - it doesn't seem to pass the '$order' into the header information to do the IF statement. It is a long shot but any thoughts much appreciated. This is my code. function change_headers($order, $object, $headers); // Get the city $city = $order->get_billing

Convert data from email header

守給你的承諾、 提交于 2020-01-01 03:11:10
问题 Does anyone could help me how to convert data from email header? I have the next date format from email header: Wed, 28 Apr 2010 21:59:49 -0400 I need to convert them into mysql Date, or timestamp. Thanks! 回答1: You should be using DateTime for this, specifically DateTime::createFromFormat(): $str = 'Wed, 28 Apr 2010 21:59:49 -0400'; $date = DateTime::createFromFormat( 'D, d M Y H:i:s O', $str); Now, you have a Date object in $date , and you can grab the unix timestamp (if that's what you want

Sending Email with PHP and ensuring it doesn't get blocked

我们两清 提交于 2019-12-29 01:14:08
问题 I want to send an HTML email with PHP. I was wondering what headers should be used in the email to ensure it doesn't get blocked or end up in SPAM folders. The email contents will contain CSS and HTML. The reply-to field will be different than the sender's ( will this affect anything? ) EDIT: I don't know why my question was voted down. Anyway, I'm not looking to email SPAM or mailing lists. The reason why I want the reply-to field to be different than the sender is because I'm creating a web