473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Outlook Redemption

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 = "in**@infovis.co.uk"
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()
Nov 20 '05 #1
8 8774
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()

Nov 20 '05 #2
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()

Nov 20 '05 #3
Tried but vs.net ide says it is readonly.

Regards

"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()


Nov 20 '05 #4
Here is the definition (readonly) I can see in vs.net Object Browser of
htmlbody;

Public Overridable ReadOnly Property HTMLBody() As String
Member of: Redemption.SafeMailItem

and here is how body is defined;

Public Overridable Property Body() As String
Member of: Redemption.SafeMailItem

"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()


Nov 20 '05 #5
I am getting this (below) in tasklist and project does not build when using
htmlbody.

C:\...\Form1.vb(116): Property 'HTMLBody' is 'ReadOnly'.

"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()


Nov 20 '05 #6
Hi

A little more info. It says v3.3.0.282 on the dll properties but when I add
it into vs under COM references, the interop file (Interop.Redemption.dll)
says v3.2.

Thanks

Regards
"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()


Nov 20 '05 #7
One approach would be to set the MailItem.HTMLBody and .Subject, then save the item and set your SafeMailItem. Then you can add the recipients.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"John" <jo**@nospam.infovis.co.uk> wrote in message news:Og**************@TK2MSFTNGP11.phx.gbl...
Tried but vs.net ide says it is readonly.

Regards

"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()



Nov 20 '05 #8
Since only reading HTMLBody property is blocked by the security patch,
that's what Redemption implements. Setting the property does not cause the
security popup, so you can set it on the original OOM object assigned to the
Item property. Or define SafeMailItem as a generic Object to avoid the
compiler errors, at run-time Redenption will forward all calls to the
properties and methods that it does not implement to the object assigned to
the Item property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi

A little more info. It says v3.3.0.282 on the dll properties but when I add it into vs under COM references, the interop file (Interop.Redemption.dll)
says v3.2.

Thanks

Regards
"Dmitry Streblechenko" <dm****@dimastr.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
You need to set the HTMLBody property rather than Body.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Om**************@TK2MSFTNGP11.phx.gbl...
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 = "in**@infovis.co.uk"
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()



Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronny Sigo | last post by:
Hello all, I am trying to make a program which sends emails without intervenience of the user. It works fine except the Outlook always displays two warnings with each email it is going t send :...
8
by: Andy Kasotia | last post by:
Warning message in Outlook 2003 while using SendObject. When i try to use sendobject to send an email, a warning massage pops up, saying that "Outlook is trying to send an email.......if this is...
2
by: Anushya | last post by:
Hi I have a problem when i loop thru recipients collection of Redemption.SafeMailItem in .net. In this code for(int intK=0;intK<rMailItem.Recipients.Count;intK++) {...
0
by: Anushya | last post by:
Hi Sorry for disturbing again and again. i need all the from, to, cc in terms of id and not Name. But when i try to access from/to/CC of mailitem(Both thru Outlook and Redemption), i get...
4
by: John | last post by:
Hi Does anyone have a vb.net example of how to use redemption to send mail through outlook? Many Thanks Regards
4
by: omrivm | last post by:
Hi, I have a problem with Outlook Redemption, every time I'm trying to create a new RDOAddressBook: Redemption.RDOAddressBook AB = new RDOAddressBook(); I get: "Retrieving the COM class factory...
9
by: H. Dederichs | last post by:
Hello NG, I would like to read and write Outlook PST-Files with my VB.NET application natively. Is there anyone who can help me with this issue? Since PST-Files are "also" Databases, aren't...
6
by: MrDeej | last post by:
Hello! Is there someone where who can givme a code example on a Outlook innbox import ta a table in Access using Outlook redemption ? This is a little bit out-of-my-league programming :)
6
by: =?Utf-8?B?UmljaA==?= | last post by:
How to suppress the Outlook 2003 security prompts from VB2005. When I tried to look at the body of a message or any other part of an outlook mailItem -- I get these annoying security prompts. I...
0
by: mrian84 | last post by:
I am trying to use Outlook Redemption 4.5 from a window service running as LocalSystem but I seem to have problems can anybody enlighten me on what to do? -I did try creating some profiles...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.