Adding headers to outgoing emails using WinRT - email

I would like to write email client app using WinRT API that would send emails with custom headers (x-headers). Content of the header will depend on content of email. Something like in this post.
I did not find any methods or properties of the EmailMessage to do it. Is there a way to register message processor down the email send pipeline (if there is a pipeline)?
Thank you

As far as I know, modifying headers for email messages is not possible in WinRT and there is no endpoint you could have that will allow you to "intercept" the messages to modify them.

Related

Store custom header (or fixed message-id) on Gmail API draft

I'm working on a chrome extension to add functionality to the Gmail message composer, and it requires either:
having a fixed Message-Id that won't change with draft updates (the API docs make it clear the Message-Id changes with every draft save, but maybe there's a way?)
Or
adding a custom header that will be included when the draft is sent.
Currently, my extension works by running in the gmail composer and replacing the standard Send button. When the user clicks my send button, I transform the message and update the draft raw message via the API. This is useful for manipulating the attachments. Then I send the message by simulating a click on the normal send button. My API changes to attachments, combined with changes in the web interface draft editor, are reflected in the sent message.
I've tried including a custom header in my drafts.update (raw) API call, and that actually does update the draft. (If I then send the draft using the API, the custom header is included in the outgoing message. However, then the web interface is left in a weird state because the draft was sent in the background using the API, while the web ui draft is still open.)
What I'd really like is to be able to add my custom header via the drafts API, and then send the message via the web interface but keep the custom header for the outgoing message. Is there any way to achieve this? Maybe through the drafts metadata endpoint?
I could also use the message-id header for my purposes, but I need to know what the final id will be before sending the message.

How to track status of email in sendgrid without using SMTP.

I want to send emails which contain different contents to same user and I need to track their status. Are there any way to do that without using SMTP.
Sounds like you want Unique Args. These are called custom_args in the v3 API mail send argument, but it's the same concept.
Once you activate the Event Webhook, all events will include the appropriate unique_args, so you can relate each specific message to each.
Also, whenever you send a message to SendGrid, the acceptange response includes a message_id, which will be in all those events.

Can I Use Postmark to Create Threaded Replies?

Like many web apps, we use Postmark to send all notifications for server side events. Many of our events are grouped and related by something simple and logical (think multiple replies to the same issue, like in GitHub).
Right now, every email sent for these related events is it's own email thread. My question is: how do I send these emails so that related ones get pushed into the same thread?
I'm not sure if this is something at the Postmark level (like include a previous message ID) or if this is something I do with SMTP (like I should format my subject better and inline previous responses), so that's why I'm seeking guidance. Also, every Google search about: "Postmark email threads" returns concerns over the thread safety of the Ruby Gem.
For more information, the app is written in PHP and right now we are znarkus/postmark-php for sending emails and jjaffeux/postmark-inbound-php for parsing inbound ones. However, I am more than willing to add any extra packages if they help me in my quest.
Thanks in advance!
You can add a few SMTP headers with the original Message-ID that most clients use to link together replies. If the original email had a Message-ID header of <123#mail.example.com> the new email you send out should keep the subject line the same and add headers of:
In-Reply-To: <123#mail.example.com>
References: <123#mail.example.com>
And that should inform clients that the two emails should be threaded.
Edit:
The value for these headers should be the SMTP Message-ID header, which is slightly confusing because it is a separate concept from the Postmark MessageID value, which is just a UUID for the email.
The SMTP Message-ID header is always in the form an email address, because that's how it's supposed to be formed, but doesn't have to be related to the from address.

SendGrid SMTP API: Multiple e-mails to the same recipient

I have a web app that uses SendGrid's X-SMTP functionality to construct a single e-mail that is then merged and forwarded to a list of recipients specified in the X-SMTPAPI header.
Documentation here: http://sendgrid.com/docs/API_Reference/SMTP_API/
I am using MVC.NET and sending the e-mail using a MailMessage object via smtp.sendgrid.net
Everything seems to be working fine as far as merging values from the header and sending out the e-mails is concerned.
However I have noticed that if I specify the same e-mail address multiple times in the "to" list, only a single e-mail is sent out (or at least I just receive the one).
Has anybody had the same experience? Anybody know of a way to get around this issue?
Thanks in advance!
SendGrid's servers will de-dupe the To array. The only way to get around this is to split duplicates into separate SMTP messages, or to change the addresses so they are not duplicates (you could use plus addressing, e.g. person#example.com and person+foo#example.com).

Email that allows auto responses via subject line with attachments

i want to host a email client on my web server that allows messages to be processed via subject line, i looked into roundcube's autoreply but that was only a global message for all incoming emails, for example, if my customer emailed me with subject line HOSTING, it would be filtered and sent an auto response with an attached pdf file of our hosting plans
I would actually use Gmail's filters to do this, as otherwise it would be quite complicated. I would forward all the mail to Gmail, and use Gmail's filters (and canned response lab feature) to respond with the PDF attachment.