Gmail New Threading Policy requires workaround - how to fix? - vbscript

Per this announcement - https://gsuiteupdates.googleblog.com/2019/03/threading-changes-in-gmail-conversation-view.html -- an email with the exact same from/to and subject will no longer thread in Gmail if the emails are system generated unless we somehow reference the original message information in the subsequent system generated emails.
Does anyone have ideas for how we would do this in CDO mail using ASP / VBScript? Am guessing we would have to call a Google API to get the message ID after it created the message as well.
Google was not able to provide any help over and above the language used in this blog article which was as below:
Additional details
If you are managing a system that sends email notifications to users
and want your emails to be threaded in Gmail conversation view, then
you have to ensure that your notifications:
1) Have the same subject
2) Have reference headers that reference IDs seen earlier in the
thread, or have references headers that consistently refer to the same
message ID
Ideas are appreciated.

I'm not sure why you're looking for any sort of Google API, this sounds to be the standard "References" and "In-Reply-To" headers that any email reply should have. Refer to section 3.6.4 "Identification Fields" in RFC 5322. To create this you'd need to read the Message-ID header of the email being replied to and use it in the References header.
Just read the Message-ID of the email you're replying to like any other header:
Dim OriginalMessageId as String
OriginalMessageId = originalEmail.Fields.Item("urn:schemas:mailheader:message-id")
And use it to create the References headers in your new email:
replyEmail.Fields.Item("urn:schemas:mailheader:references") = OriginalMessageId
replyEmail.Fields.Item("urn:schemas:mailheader:in-reply-to") = OriginalMessageId
If you need more of a pointer of how this would work, you might need to include more of the code of how you're reading a message and how you're replying to it.

Related

Can i put hidden token inside email while sending email through laravel

I want to send a email to the user from my laravel application. But i want to add a hidden token in that email so that user cannot see it and when user reply to that mail i can read that token and further use it.
Is it even possible?
I am using laravel 5.6 and sending emails using SMTP
There are several ways to do it but none is ideal. Let's start with your idea:
You can add a token within the message, but it can never be invisible, the contents of the message have to be fully visible. Even so, if the reply simply doesn't contain the original message, you will lose the reference
The standard way of tracking replies is based on Message-ID, since every email has to have unique Message-ID. Since you mentioned that you are using SMTP, that allows you to setup Message-ID upfront, otherwise, you'd retrieve it after the message is sent. It helps in a way that you can store that value in the database and automatically link it to the recipient.
Then, you'd look for In-Reply-To: and/or References: headers which should mention the original Message-ID if the reply is properly formatted, which doesn't have to be the case.
Ultimately, depending on your use case, you might not need any of these and you could just keep the sent email based on the recipient email address and extra information that you wanted to pass in the email within your database. Assuming that you'd expect an email from the same recipient email address, you could just figure out the token locally.

Logic Apps Email Trigger - Get original Alias

Found a very similar question here: Email aliases not returned as "To" address in logic app
TLDR: From within a logic app "When a new email arrives" trigger, How do I get the original alias that the email was sent to?
I have a logic app that creates a ticket based off an email sent to an outlook box. Now I want to be able to choose aspects of the ticket based off of whether or not the email was sent to the mailbox itself or an alias of the mailbox. The problem I'm having is that by the time logic apps gets a hold of the email, the alias address has already been replaced with the actual box's address ("alias1#place.com" -> "actualbox#place.com").
The actual mail in the inbox has the original email's alias information in the headers, but I can only get them by looking at the properties in outlook. I've tried to get the original "To" internetheader information both within logic apps (by exporting the email to blob storage and looking at headers there) and with the Microsoft Graph API. Sadly, the email exported by logic apps doesn't have the alias information and Graph API has pretty much every header but "To". At least one other person has lamented the lack of To
That said, the actual email still has the original alias information. Can someone help me get that information in logic apps without jumping through too many hoops? A many hoop solution is welcome if none other can be found though.
Use the Export email (V2) action from the Office 365 Outlook connector. This will give you the full message with original headers (including the actual To address)!
The flow here is, trigger on the incoming email, as you already are, then add the export email action providing the message id from that trigger to pull this specific email.
From there, you you'll have one big "body" property which you'll need to interrogate to find the To address.
Caveat on this though, it doesn't work when emails are sent between mailboxes in the same Office 365 tenant. Exchange Online will "helpfully" go, "I know that address... this is the address you wanted!"
What API are you using? In Outlook Object Model / MAPI / EWS, you need to retrieve the PR_TRANSPORT_MESSAGE_HEADERS MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x007D001F)
We arrived at a many hoop solution.
The "Primary" email box now has some rules that look at the internet headers mentioned above (Message -> Properties -> look for 'To:').
If it finds an alias there, it will put the email in a corresponding folder for each alias.
Then we have logic apps listening to each of the alias folders which will then send the email's information to the _Core logic app that does the actual processing.

PHPMailer thread/conversation in outlook not working

I've achieved the "conversation/thread" effect in gmail, using this code
$phpmailer->MessageID = $message_id;
and with this, in gmail all e-mails sent (with the same value in $message_id) are received in the same "conversation/thread", but this dont work in outlook, both windows 10 email app and outlook app for windows 10...
How can i achieve the same result as in gmail in outllook?
Don't re-use the same message ID for multiple messages. There are headers specifically for creating threads, and the definitive explanation for them is here. In short, add the Message-ID of the message you are replying to in a References header, and optionally also into an In-reply-to header. You can create those headers in PHPMailer using addCustomHeader().

Gmail API is overwriting the custom Message-ID header while sending emails

We are using the Gmail API to send emails on behalf of the users of our App. On the header of the emails we send via the Gmail API, we are setting a custom Message-ID.
Nevertheless Gmail is overwriting the Message-ID we set with a different one . The following are some Message-IDs that we have tried:
<8368110f-6ffc-46f8-8e67-7ebf0e1a1d83#domain>
<4fb7a8b7013099c524f70906e009b46218461fff0b2dc0f8b794eb2df26e93d7#domain>
Any idea why this ID overwriting is happening ?
I would really appreciate any help
Thanks in advance
You can try custom id with .(dot) before left side of '#'.
It worked for me.
For more details, Please refer the following RFC's. These are really helpful for creating syntax for Custom message-id.
RFC 2822
RFC 5322
Hope this would also work for you.

How to know mail send or not send in laravel and which recipient is not getting it?

Hi I am using the bellow function, can you please guide me how can I use Mail::failures(); in it
Mail::send('emails.caregiversetprimary', $templateArray, function($message)use($email)
{
$message->to($email, 'username')->subject('my subject');
});
Mail::failures(); < ====== this gives me black array as I have used wrong email
I am using laravel 4.1
tl;dr
You can know which recipients the email has been sent to but no which recipients have received it.
details
You need a better understanding of how mail servers work. From a Laravel point of view, there is no way (or at least not a simple one*) of knowing which recipients got the email. Its a matter of how mail protocol works. You may know which recipients the message has been sent to but no which recipients actually got it.
With Mail::failures() you get a list of recipients to which Laravel tried to send the email but it failed on actually sending it. But again, if it has been sent there is no straightforward way to known if the mail reached their inbox or no.
*If you happend to use Mailgun, Mandrill or any other 3rd party software then you are not dealing with a mail server 'per se' but with an API service. May be you could check the mail service provider documentation to research if they perform any kind of delivery tracking that you can programatically check.

Resources