I’m trying to get the companny name from a outlook message.
I first retrieve all the messages, then loop the list and use item.Body.Substring(item.Body.IndexOf(“From”) to cut a part of the body of and make shure I’m getting the correct emailadress, then I tried to use .Substring(.IndexOf("@")+1, .IndexOf(".")) to get the domainpart of the emailaddress, but getting more then I ask for
For example for the emailaddress email@example.com, I’m getting abm-tecna.be> Sent: F
while I’m trying to get abm-tecna.
Anyone knows how to achieve this and more important why my end of the substring dosnt work?
BTW before someone asks why I don’t try to acces the from directly by using item.From.Address I refer to my other post, where I explain that I tried it, but it didn’t work, so this a workaround untill someone provides me with a possible answer on the different post, but I will still need it to select the domainpart in the from