473,387 Members | 1,721 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,387 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 8772
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.