Announcement

Collapse
No announcement yet.

How to send an html email?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to send an html email?

    Could anyone pls share a script or portion of script that can be used to send an html formatted email? I would like to be able to send status emails from HS that include images and html formatted text.

    I have been trying but ran into many different errors with (possibly) scripting references, overload resolution failed, part of path not found...

    Obviously I am doing it completely wrong, and would prefer to restart from scratch, if anyone has got it working and would like to share...

    Thanks

    Sandro

    #2
    This should get you on the way...

    Code:
    Imports System.Text
    
    Sub Main(Optional ByVal Parms As String = "")
        Dim sb As New StringBuilder
    
        sb.Append("<font size=5>This is a test from HS3</font>")
        sb.Append("<br>")
        sb.Append("<font color=red><b>The device value for Ref 789 is " & hs.DeviceValueEx(789).ToString & " </b></font>")
    
    
        Try
            hs.SendEmail("ToEmailAddress", "FromEmailAddress", "", "", "Test Subject", sb.ToString, "")
        Catch ex As Exception
            hs.WriteLog("Info", "Error in send email " & ex.tostring)
        End Try
    
        sb = Nothing
    
    
    
    End Sub

    Comment

    Working...
    X