Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HTML in MAPI class
Message
 
To
30/05/2003 10:37:20
Humberto Ramirez
H. Ayuntamiento de Colima
Colima, Mexico
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00794506
Message ID:
00794526
Views:
12
For any email HTML formatted message in Outlook Express open Properties - Details - Message Source.
It gives you an understanding how such message should be formatted.

You will see something like
Content-Type: multipart/alternative;
  boundary="NextPart_048F8BC8A2197DE2036A"

This is multi-part message in MIME format.

--NextPart_048F8BC8A2197DE2036A
Content-Type: text/plain; chars
and then
--NextPart_048F8BC8A2197DE2036A
Content-Type: text/html; charset=iso-8859-1
Content-Type value is important.

For MAPI and Winsock you have to create all parts by yourself. CDO approach is more convenient:
#DEFINE cret  Chr(13)+Chr(10)
LOCAL cdoMsg
cdoMsg = CreateObject('CDO.Message')

WITH cdoMsg
	.Sender = 'info@myhost.com'    && replace with your address
	.To = 'myfriend@somewhere.com' && replace with valid recipient email

	.Subject = 'Message in HTML format sent using Microsoft CDO'

	.HTMLBody = '<h1>What could be simpler?</h1>' +;
		'<p>Sending emails with <Strong>Microsoft CDO</Strong> appears to be ' +;
		'the <Em>simplest</Em> way you have ever tested.</p>'

	WAIT WINDOW NOWAIT 'Sending message...'
	.Send
	WAIT CLEAR
ENDWITH
Just using HTMLBody property instead of TextBody creates HTML formatted email message automatically.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform