My company has a list of "Trusted" domains that we are allowed to open links and attachments when we receive emails from these domains. If the email comes from outside our company, it is automatically get a highlighted phrase added to the body of the email to let us know it is from an outside source, but it also does this for the emails that come from the "Trusted" domains.
The "Trusted" domains are listed on our company's intranet. I would like to grab the domain of the sender's email address and then search the internal web page to see if the domain is found on that page and if it is, add a category to the email as "Trusted".
I'm not a great coder and primarily just hack through examples that I find on the web, but I haven't been able to find anything that does all of these things for me.
This is what I have so far.
Any assistance you could provide would be greatly appreciated.
Thank you in advance!
The "Trusted" domains are listed on our company's intranet. I would like to grab the domain of the sender's email address and then search the internal web page to see if the domain is found on that page and if it is, add a category to the email as "Trusted".
I'm not a great coder and primarily just hack through examples that I find on the web, but I haven't been able to find anything that does all of these things for me.
This is what I have so far.
Code:
Sub GoToEdge()
Dim objMail As Outlook.MailItem
Dim senderaddress As String
Dim senderdomain As String
Dim addresslen As Integer
' Sender E=mail Address
senderaddress = objItem.SenderEmailAddress
'Searches for @ in the email address and gets the domain
addresslen = Len(senderaddress)
senderdomain = Right(senderaddress, addresslen - InStr(senderaddress, "@"))
'open website'
CreateObject("Shell.Application").ShellExecute "microsoft-edge:https://internalsitepage.com/Trusted.aspx"
'search page for senderdomain'
End Sub
Any assistance you could provide would be greatly appreciated.
Thank you in advance!