EmersonH.Com

Transforming Knowledge into Power

  • Increase font size
  • Default font size
  • Decrease font size

Send Email

E-mail Print

 

Please note that you will have to add a reference for Microsoft.Office.Interop.Outlook 12.0.0.0 and a Reference to Redemption.dll.

Private Function EmailCSC(ByVal strName As String, ByVal strSSN As String) As Boolean

 

Dim strEmailAddress As String

Dim objApp As Object, NS As Object

Dim SafeItem As Object, oItem As Object

Try

EmailCSC = False

objApp = CreateObject("Outlook.Application")

NS = objApp.GetNamespace("MAPI")

NS.Logon()

objApp = CreateObject("Outlook.Application")

NS = objApp.GetNamespace("MAPI")

SafeItem = CreateObject("Redemption.SafeMailItem")

oItem = objApp.CreateItem(0)

SafeItem.Item = oItem

SafeItem.To = " This e-mail address is being protected from spambots. You need JavaScript enabled to view it "

SafeItem.Subject = "Test" & strName.ToString

SafeItem.Body = "Client " & strName.ToString & " :" & strSSN.ToString

SafeItem.Send()

SafeItem = Nothing

oItem = Nothing

NS = Nothing

objApp = Nothing

EmailCSC = True

Catch ex As Exception

MsgBox("Err: " & ex.Message, MsgBoxStyle.Critical, "Test")

EmailCSC = False

End Try

End Function

Last Updated on Monday, 21 December 2009 17:42