I was wondering if anyone knew whether there is a unique identifier attached to an email that I can use to verify whether emails are the same? I know about the EntryID and PR_SEARCH_KEY, but i need something abit more specific if it exists.
Supposed I forward an email to 3 people. I want to make sure that at most 1 copy of those forwarded emails is added to a database. Is there an identifier that will be shared between those three emails that i can record and use to disallow entry of the other two? Or will I have to add a manual tag somewhere on the email?
thanks
The obvious answer is the Message-ID, which all good emailers use. However, not everyone in the world uses it.
Related
I am having a similar problem to the one described in this previously asked question, but I am looking for a bit more detail in the answer as my lack of experience in this area doesn't allow me to fill in some of the blanks:
Tag Outlook MailItem with ID number before send without causing TNEF (RTF) send
Like the asker of that question, I would like to set a User Property, say it's named "XXXX", to a MailItem while the user is composing it, so that when the user later revisits that same MailItem in his or her Sent Items folder I could read the "XXXX" property's value again.
My additional questions would be as follows:
Dmitry Streblechenko suggests using MailItem.PropertyAccessor.SetProperty, but wherever I see that used I see people using a schema link to represent the property. What would be the correct schema link to use if I want my property still to be known as "XXXX"? In other words, what would be the correct syntax to use in Dmitry's suggestion?
I gather I could use a ".GetProperty" call to read the property later from the Sent Items, but the problem is that our add-in has been around for years, and users sent items are already full of MailItems with the original UserProperty "XXXX" in them. Will I still be able to use UserProperties to get property "XXXX" even if I use .PropertyAccessor.SetProperty to set them?
Alternatively, if I kept using the original code to set UserProperties while composing the message, but I then used .PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", false) during the ItemSend, like the original poster is suggesting, then I understand the UserProperties are not sent out with the message, which is fine by me, but will they still be available when revisiting the message in the Sent Items folder? Eugene Astafiev suggests that it's safe to use that .SetProperty call, but he doesn't clarify whether it affects what happens to the message at the Sender's end.
My personal preference would be a solution that would a) allow me to send the item without having to force Outlook in any way to send the message in any particular format and b) be able to continue to access the properties in the users' inboxes as we always have through the MailItem's UserProperties, but I am aware that I may be asking for something impossible here.
You need a property in the PS_INTERNET_HEADERS namespace. E.g. http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/x-my-prop.
Yes if you specify the full DASL name.
Yes, the user property will still be there in the Sent Items folder.
I have a custom field called Email_address and I want to set-up a validation that sends an error message if the email isn't a gmail address. How would I set this up?
Also, is there a way to send an error message if the email address isn't unique?
Thanks so much!
I don't know what you mean by 'send an error.'
If you want to prevent incorrect entry, use a validation rule. I'd generally use a regular expression to evaluate something like an email address, but if you're uncomfortable with them you can also use something like RIGHT(my_field__c, 9) <> "gmail.com". If, for some reason, you want to be notified of incorrect email addresses but still allow them to be entered, you can use a workflow that behaves mostly the same way.
Preventing duplicate email addresses is a bit more difficult unless you want to venture into trigger-land, which is massive overkill for something like this IMHO. You can make the field a unique ID in the custom field creation wizard (although I believe you only get a finite number of these), but other than that I don't know of a way that doesn't involve a trigger and a SOQL query.
For example, I have a field that give user to type their domain, the user can type any domain on this, but I don't valid this domain is belong that user. Of course, I can generate a random number text file for user to upload, and when I get the random number text file, if it is match, I can just treat it as a valid domain holder. But, except from this method, is that anyway to do so? Thanks.
Options I have seen:
Have user Create a Text file in document root, check for it
Send Email to contacts listed in whois (Or other ROLE type accounts (postmaster, hostmaster, etc...), with token they need to
return
Have them create an 'A' record in their DNS that is unique and you can query for.
There really isn't any other way of telling if they have control over the domain. Using whois information isn't 100% accurate as people don't update it, or their info isn't registered to them, or is hidden behind something like domains by proxy. There is no standard information in DNS, that can tell you ownership. Since google uses the DNS method and the text file method (I think), you can probably safely assume that is a good way to verify it.
We've got a few emails that get sent out by our ASP.NET MVC 3 application.
In one of the emails, we want to add "Did you find this helpful?" to the footer of the email.
If they click "Yes", some action needs to be taken in the database.
What approach should i take for these links?
I don't really like the idea of doing a GET (e.g when they click the link), which then adds something to the database. GET's should never update state. Is there a way i can make it do a POST instead?
I'm using ActionMailer to perform emails, if that matters.
EDIT:
To be clear, i'm how asking "how" to implement the MVC side of things. I know i can create an action which takes the id, etc and saves to the DB, but i'm asking about what is the correct approach from a REST-style point of view.
You can create a form and do a POST in an email but it wont work with certain mail clients. Here is a reference from 2007 that shows where it works and where it doesn't:
http://www.campaignmonitor.com/blog/post/2435/how-forms-perform-in-html-emai/
ETA: A POST would of course fit the REST pattern but probably not a good option in your case. Since you are presumably just incrementing a counter for helpfulness, having this URL exposed shouldn't cause much of a problem.
I am trying to create a Model of a pretty special kind.
I just call it Emails. Containing fields like:
address
send_count
blocked
It is a registry of email addresses. Every record in other models that contain an email address should have a reference to a record in this model. That way I can block/ban and email address globally in my app and flag it in other ways.
If it was not generally frowned upon, I'd say the address should work much like the primary key. I can only be set on create and then never updated and it must be unique.
My problems implementing this (with a normal primary key) is how to handle cased where Emails is updated/created as an associated model via nested attributes. This is the most common situation since the email addressed look just like any other field to the users of the application.
They might be editing their account form and happen to change their email address. Phone should notice this and "find_or_create" an instance of itself instead of updating the address. Updating the blocked property on the other hand should be allowed.
Am I getting the gist of it across? Can anyone give me some advice on how to make the Model behave like this?
I have tried some variations of using validations and callbacks but I can seem to "replace self" with another existing record. Just setting all attributes (incl. id) to those of the existing record does not really make things work fully.
Any ideas would be helpful.