Extract links from email based on the anchor text, not the href
Automatically execute html in an email.

I'm not familiar with Smart Mailbox and what language it uses but below is a VBA script for Outlook that searches for the text "Click" which is a href to a URL, extracts the URL and executes it in Internet Explorer as a weblink.

The code is very messy with very little documentation but it uses the Split Array functionality of VBA to break out the lines of the email message and then extract the correct string after double quotes ""(Chr(34)) using array positioning ie. array urltag(1) - first element in array urltag.

Hope this helps someone.

LaunchURL(itm As MailItem)

Dim bodyString As String
Dim bodyStringSplitLine
Dim bodyStringSplitWord
Dim targetline
Dim urltag
Dim splitLine
Dim splitWord
Dim intCount As Integer
Dim Fail As Integer
Dim Beforecurrent As Integer
Dim Aftercurrent As Integer
Dim Found As Integer


Fail = 0
Found = 0

bodyString = itm.HTMLBody ' Mailitem.body vs Mailitem.HTMLBody  - oMailitem.body
bodyStringSplitLine = Split(bodyString, vbCrLf) 'vbCrLf has no meaning in HTML?

For Each splitLine In bodyStringSplitLine
    bodyStringSplitWord = Split(splitLine, " ")


    For intCount = LBound(bodyStringSplitWord) To UBound(bodyStringSplitWord)
    'For Each splitWord In bodyStringSplitWord ie find out how many iterations to do.

    If intCount &gt; 2 Then
    Beforecurrent = intCount - 1
    Aftercurrent = intCount + 2
    Else
    Beforecurrent = 1
    End If

        If bodyStringSplitWord(intCount) = "click" Then

            targetline = bodyStringSplitWord(Aftercurrent)
            urltag = Split(targetline, Chr(34))
           'i = MsgBox(urltag(1), vbOKOny) test box remove apostrophe to uncomment

            Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE" &amp; " " &amp; urltag(1))
           'Shell ("cmd" &amp; " " &amp; "/k" &amp; " " &amp; "echo" &amp; " " &amp; bodyStringSplitWord(Aftercurrent) &amp; " " &amp; Fail &amp; " " &amp; Beforecurrent)   test box remove apostrophe to uncomment

        Found = 1

        Exit Sub
        Else:

        Fail = Fail + 1

        'Shell ("cmd" &amp; " " &amp; "/c" &amp; " " &amp; "echo boo hoo") Test box remove apostrophe to uncomment

        End If
    Next

Next

Set itm = Nothing

End Sub