473,725 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.CommandBars. FindControl(1, 5488)
Btn.Execute()
Utils.Cleanup()
Nov 20 '05 #1
8 8803
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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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.Safe MailItem

and here is how body is defined;

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

"Dmitry Streblechenko" <dm****@dimastr .com> wrote in message
news:uB******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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.Redemp tion.dll)
says v3.2.

Thanks

Regards
"Dmitry Streblechenko" <dm****@dimastr .com> wrote in message
news:uB******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.CommandBars. FindControl(1, 5488)
Btn.Execute()
Utils.Cleanup()


Nov 20 '05 #7
One approach would be to set the MailItem.HTMLBo dy 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.in fovis.co.uk> wrote in message news:Og******** ******@TK2MSFTN GP11.phx.gbl...
Tried but vs.net ide says it is readonly.

Regards

"Dmitry Streblechenko" <dm****@dimastr .com> wrote in message
news:uB******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP10.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.Redemp tion.dll)
says v3.2.

Thanks

Regards
"Dmitry Streblechenko" <dm****@dimastr .com> wrote in message
news:uB******** ******@TK2MSFTN GP09.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.in fovis.co.uk> wrote in message
news:Om******** ******@TK2MSFTN GP11.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_InetMailOver rideFormat = &H59020003
Const ENCODING_PREFER ENCE = &H20000
Const BODY_ENCODING_T EXT_AND_HTML = &H100000
Const ENCODING_MIME = &H40000
Const PR_MSG_EDITOR_F ORMAT = &H59090003
Const EDITOR_FORMAT_P LAINTEXT = 1
Const EDITOR_FORMAT_H TML = 2
Const vbLFCR = Chr(10) & Chr(13)

Dim SafeItem As Redemption.Safe MailItem
Dim oItem As Object
' Dim oItem As Outlook.MailIte m
Dim Utils As Redemption.MAPI Utils
Dim ol As Outlook.Applica tion
Dim Btn As Office.CommandB arButton
Dim ns As Outlook.NameSpa ce

ol = New Outlook.Applica tion
ns = ol.GetNamespace ("MAPI")
ns.Logon()
oItem = ol.CreateItem(O lItemType.olMai lItem)
SafeItem = New Redemption.Safe MailItem 'Create an instance of
Redemption.Safe MailItem
SafeItem.Fields (PR_InetMailOve rrideFormat) = ENCODING_PREFER ENCE Or
ENCODING_MIME Or BODY_ENCODING_T EXT_AND_HTML
SafeItem.Fields (PR_MSG_EDITOR_ FORMAT) = EDITOR_FORMAT_H TML
SafeItem.Item = oItem 'set Item property
oItem.To = "in**@infovis.c o.uk"
SafeItem.Recipi ents.ResolveAll ()
SafeItem.Subjec t = "Testing html in Redemption" ' <== Error: Property
Subject not supported
SafeItem.Body = "<HTML>" & vbLFCR & _
"<HEAD>" & vbLFCR & _
"<TITLE>Message </TITLE>" & vbLFCR & _
"<BODY>" & vbLFCR & _
"<p><strong>Thi s 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.MAPI Utils
Utils.DeliverNo w()
Btn = ol.ActiveExplor er.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
5849
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 : 1) That a "program tries to get access to the emailadresses in the contactlist - and wether I want to allow this" and 2) That a program is trying to send emails on my behalf - and wether I want to allow this. I tried to work around this by using...
8
5084
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 a virus, you should choose no." Can I do away with this message and have it send the email without user intervention? I wasn't able to find any optional parameters for the SendObject that
2
5307
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++) { MessageBox.Show(rMailItem.Recipients.Type.ToString()); MessageBox.Show(rMailItem.Recipients.Address.ToString()); MessageBox.Show(rMailItem.Recipients.Class.ToString()); }
0
1596
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 Names instead of ID. Could get the senderID thru Redemption.SafeMailItem.Sender.Address. But how to get the id of To and CC(recepients)??
4
19313
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
10318
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 for component with CLSID {...GUID...} failed due to the following error: 80040154." I tried to reregister the Redemption DLL but I still get this exception... My OS is win server 2003 sp1 it may be the problem?
9
14600
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 they? Maybe there ist a way to do this with an Active Sync API if existing? Hints with sample are highly appreciated. B.T.W.
6
5712
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
1985
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 have to loop through several emails a day. Is there some code for suppressing this? I saw some articles about a product called Outlook Redemption which supposed suppresses these messages. I have not tried it. Anyone know how to use it? ...
0
1603
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 using ProfMan.dll but this failed to save the profile when running as localsystem. - I tried to call MAPIInitialise passing the MAPI_NT_SERVICE - I also tried to connect by calling MAPILogonEx with the MAPI_NO_MAIL flags MAPI_NT_SERVICE (After...
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9116
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.