Search code examples
htmlvbaemailheadermailto

Adding hidden data to HTML MailTo URL


I'm trying to send an email with hyperlinks with "mailto", to email me back. I'm trying to automate the replies as they come in using mailitems in VBA, for example:

Dim Item As MailItem
Set oItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
For Each Item In oItems

etc. And searching for key words/IDs to indicate which link the sender has clicked, however the chance of the sender changing the subject or body of the email would be a spanner in that plan.

Is there a way that I can embed some hidden data (like an ID and yes/no response, for example) in the HTML of the mailto in order to properly identify the emailer, even if they change all the visible email data, and then what is the best way of accessing that data using code similiar to the above?

Is there a better way of doing this? Am I approaching this the wrong way? or am I totally barking up the wrong tree?

Thanks for your help!


Solution

  • You won't be able to pass an hidden data with a mailto, everything could be changed by the sender.

    A better way of doing it is to make a little form in HTML & PHP (for example), with in your emails a link to this form passing the ID in the url, then retrieve this ID in your form, then saving this ID when the form is submitted.

    You could also make links in your emails pointing to a redirection page saving the ID passed in parameter in the url then redirecting to the mailto: final 'link'. It would allow you to know who clicked on which link in your emails.