J
John
Hi
I am using the latest redemption. I am using the below code in vb.net to
send mail in html format. The problem is that text does not get sent as html
and html tags appear as they are in the message like '<HTML>' etc. Any idea
what I am doing wrong?
Thanks
Regards
Yahya
Imports Outlook
Imports System.Runtime.InteropServices.Marshal
Imports Redemption
Const PR_InetMailOverrideFormat = &H59020003
Const ENCODING_PREFERENCE = &H20000
Const BODY_ENCODING_TEXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_FORMAT = &H59090003
Const EDITOR_FORMAT_PLAINTEXT = 1
Const EDITOR_FORMAT_HTML = 2
Const vbLFCR = Chr(10) & Chr(13)
Dim SafeItem As Redemption.SafeMailItem
Dim oItem As Object
' Dim oItem As Outlook.MailItem
Dim Utils As Redemption.MAPIUtils
Dim ol As Outlook.Application
Dim Btn As Office.CommandBarButton
Dim ns As Outlook.NameSpace
ol = New Outlook.Application
ns = ol.GetNamespace("MAPI")
ns.Logon()
oItem = ol.CreateItem(OlItemType.olMailItem)
SafeItem = New Redemption.SafeMailItem 'Create an instance of
Redemption.SafeMailItem
SafeItem.Fields(PR_InetMailOverrideFormat) = ENCODING_PREFERENCE Or
ENCODING_MIME Or BODY_ENCODING_TEXT_AND_HTML
SafeItem.Fields(PR_MSG_EDITOR_FORMAT) = EDITOR_FORMAT_HTML
SafeItem.Item = oItem 'set Item property
oItem.To = "(e-mail address removed)"
SafeItem.Recipients.ResolveAll()
SafeItem.Subject = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message</TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>This is just a test html file to demo html
emailing.</strong></p>" & vbLFCR & _
"<p><BR>" & vbLFCR & _
"</p>" & vbLFCR & _
"</BODY>" & vbLFCR & _
"</HTML>"
SafeItem.Send()
Utils = New Redemption.MAPIUtils
Utils.DeliverNow()
Btn = ol.ActiveExplorer.CommandBars.FindControl(1, 5488)
Btn.Execute()
Utils.Cleanup()
I am using the latest redemption. I am using the below code in vb.net to
send mail in html format. The problem is that text does not get sent as html
and html tags appear as they are in the message like '<HTML>' etc. Any idea
what I am doing wrong?
Thanks
Regards
Yahya
Imports Outlook
Imports System.Runtime.InteropServices.Marshal
Imports Redemption
Const PR_InetMailOverrideFormat = &H59020003
Const ENCODING_PREFERENCE = &H20000
Const BODY_ENCODING_TEXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_FORMAT = &H59090003
Const EDITOR_FORMAT_PLAINTEXT = 1
Const EDITOR_FORMAT_HTML = 2
Const vbLFCR = Chr(10) & Chr(13)
Dim SafeItem As Redemption.SafeMailItem
Dim oItem As Object
' Dim oItem As Outlook.MailItem
Dim Utils As Redemption.MAPIUtils
Dim ol As Outlook.Application
Dim Btn As Office.CommandBarButton
Dim ns As Outlook.NameSpace
ol = New Outlook.Application
ns = ol.GetNamespace("MAPI")
ns.Logon()
oItem = ol.CreateItem(OlItemType.olMailItem)
SafeItem = New Redemption.SafeMailItem 'Create an instance of
Redemption.SafeMailItem
SafeItem.Fields(PR_InetMailOverrideFormat) = ENCODING_PREFERENCE Or
ENCODING_MIME Or BODY_ENCODING_TEXT_AND_HTML
SafeItem.Fields(PR_MSG_EDITOR_FORMAT) = EDITOR_FORMAT_HTML
SafeItem.Item = oItem 'set Item property
oItem.To = "(e-mail address removed)"
SafeItem.Recipients.ResolveAll()
SafeItem.Subject = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message</TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>This is just a test html file to demo html
emailing.</strong></p>" & vbLFCR & _
"<p><BR>" & vbLFCR & _
"</p>" & vbLFCR & _
"</BODY>" & vbLFCR & _
"</HTML>"
SafeItem.Send()
Utils = New Redemption.MAPIUtils
Utils.DeliverNow()
Btn = ol.ActiveExplorer.CommandBars.FindControl(1, 5488)
Btn.Execute()
Utils.Cleanup()