How to get displayName (Name, Surname) from external organization smtp address in Outlook API? - vba

all, and thanks for your support.
I have a list of e-mails (ex: johndoe#company1.com, maryjane#company2.com) and need their DisplayTo names.
By "DisplayTo" I mean the name that appears after the first e-mail is sent ("ABC" in red).
So it should be something like "John Doe" or "Jane, Mary", which is how future e-mails to them appear (only the first one appears as name#company.com).
The Address Catalog only has internal company e-mails. I could not find a way to get this information in Outlook API documentation, is there a way to do this?
Thanks a million!

Pass the SMTP address to Namespace.CreateRecipient (returns Recipient object). Call Recipient.Resolve, then use Recipient.AddressEntry.GetExchangeUser.FirstName/LastName/etc (error / null checking omitted).

Related

AD B2C default signup-sign-in flow returns the "emails" claim with value type string instead of array

I am writing .Net Core API code that examines the value of the AD B2C built-in emails claim. I'm expecting this claim to show up on the ClaimsPrincipal as an IList<string> or similar, but it is instead of type string.
The Email Addresses claim is selected in the Azure portal and shows a data type of StringCollection and the emails claim appears on the ClaimsPrincipal but it is of type string. The data I am working with only has a single email address per user so I'm not sure what would happen if there were multiple email addresses.
I understand why AD returns an emails claim (plural) rather than an email claim (singular) so why is the emails claim value a string (the user's email address) instead of an array containing that single email address?
This:
emails: 'email#somedomain.com'
Instead of this:
emails: ['email#somedomain.com']
I'm currently on .NET Core 3.1
Updated to .NET 6 and I still experience the same thing. Am I missing a setting in AD or elsewhere? Is this the expected behavior?
When i tried i got the alternate email address in stringCollection format.
Please try to raise a support request if two or more mails when added are not reflecting in the emails claim else its not an issue AFAIK.

URN Filter to Ignore Emails

I am using UiPath's Get Outlook Mail Messages component to obtain emails.
My only request has been to ignore any emails that are Replies, so contain "RE:"
In my email filters I had tried the below:
#SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'
Unfortunately, I receive the error "Get Outlook Mail Messages: Cannot parse condition. Error at "#SQL=((urn:schemas:httpmail:subject NOT ...".
When I try the filter: `
#SQL=urn:schemas:httpmail:subject LIKE 'RE%'
I am able to obtain all emails that contain 'RE:' but as specified, I want to omit these.
Would anyone be able to advise how to Omit these emails? I need to obtain every other email in the Inbox so makes more sense to just ignore the Replies.
Thanks,
Your code is very close to being correct. The NOT keyword does work, just the placement is incorrect, unlike normal SQL where the NOT would be before the LIKE, in this case it would come before the field name.
So rather than:
#SQL=urn:schemas:httpmail:subject NOT LIKE 'RE%'
It would be:
#SQL=NOT urn:schemas:httpmail:subject LIKE 'RE%'

Getting a contact by email using the sendgrid api

I'm trying to retrieve contact id by email using the sendgrid 'Contacts API'. It looks like the way to do this is to POST to the /marketing/contacts/search endpoint.
I'm not familiar with SQL, does anybody know how I'd query the email field as explained here:
https://sendgrid.api-docs.io/v3.0/contacts/search-contacts
on the link that you provide there is a tab that is called "try it out" click there and you can try it out. Just add your Api token and there is already a query that you just need to add the email address
{
"query": "email LIKE 'ENTER_COMPLETE_OR_PARTIAL_EMAIL_ADDRESS_HERE'"
}
if you are adding a partial email address just add % before or/and after (depending which side is missing info)

How to do perform "contains" in Excel

Cell A contains users email address and B contains domain. (ex: email as a#gmail.com, domain is gmail. email as b#yahoo.com, domain is yahoo etc).
I want to find out domain and the email address matching or not. I am not quite sure how to perform this in excel.
use Search and Isnumber:
=ISNUMBER(SEARCH(B1,A1))
Using find and search :
=IFERROR(IF(FIND("#",A1)+1=SEARCH(B1,A1),TRUE,FALSE),FALSE)

Extract single messages from gmail thread (Objective-c)

I am trying to fetch gmail emails with IMAP (in objective-c), and I want to separate, for every thread, every single message that has been sent in the conversation. To make myself more clear, imagine a conversation like this one:
John says : Hi Mike, that's the first email
Mike replies : Hey John, how are you ?
John replies : Great Mike, thanks.
If I get John's emails through IMAP, I will fetch only one email, that will be :
Hey John, how are you ?
On Wed, 21 May,
Hi Mike, that's the first email
And I would like to get two different messages out of this one email I fetched.
First message would be "Hi Mike, that's the first email"
Second message would be "Hey John, how are you ?"
I looked at the message-id field in the header, but I can't figure out how to link that back to actual messages.
Any ideas?
Thanks !
[EDIT] : So far I can parse the email in John's inbox and extract the associated string containing the message. But what I want is the actual message (with the header and all), not just the string containing the message.
Gmail has a very nice IMAP extension to do this. I've never tried to use the objective-c libraries, though.
If you want to do this for one conversation, you need a message to start with. Any message in the conversation will do. First, you retrieve the X-GM-THRID of that message: a uid fetch 23451345 x-gm-thrid, which gives you a 64-bit number, perhaps 9876543876543444423. Next, you look for the other messages in the same conversation: b uid search x-gm-thrid 9876543876543444423, which gives you the UIDs of all messages in that conversation, and you're done.
If you want to do it for all the conversations in the inbox, you issue c uid fetch 1:* x-gm-thrid, which gives you a set of message-conversation tuples: "message 123 belongs to conversation 9876543876543".
If you want to order the messages within each conversation, the easiest way is probably to retrieve the internaldate item and sort by that. Gmail also has an x-gm-msgid but I haven't looked to see whether it's useful for sorting.