如何用MapiSendMail函数发送html格式的邮件 (请大狭帮帮我吧)(100分)

Y

yj8888

Unregistered / Unconfirmed
GUEST, unregistred user!
如何用 MapiSendMail 函数 发送 html 格式
(调用outlook发送email程序的MapiSendMail函数)
function MapiSendMail(lhSession: LHANDLE;
ulUIParam: Cardinal;
var lpMessage: TMapiMessage;
flFlags: FLAGS;
ulReserved: Cardinal): Cardinal;
请问如何设置参数?
//设置信息类型指针,
lpMessage.lpszMessageType := 'Text/Html'
不行
我曾参考过如下资料
http://www.clarionmag.com/col/99-03-mapi.html
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3897698
type
PMapiMessage = ^TMapiMessage;
{$EXTERNALSYM MapiMessage}
MapiMessage = packed record
ulReserved: Cardinal;
{ Reserved for future use (M.B. 0) }
lpszSubject: LPSTR;
{ Message Subject }
lpszNoteText: LPSTR;
{ Message Text }
lpszMessageType: LPSTR;
{ Message Class }
lpszDateReceived: LPSTR;
{ in YYYY/MM/DD HH:MM format }
lpszConversationID: LPSTR;
{ conversation thread ID }
flFlags: FLAGS;
{ unread,return receipt }
lpOriginator: PMapiRecipDesc;
{ Originator descriptor }
nRecipCount: Cardinal;
{ Number of recipients }
lpRecips: PMapiRecipDesc;
{ Recipient descriptors }
nFileCount: Cardinal;
{ # of file attachments }
lpFiles: PMapiFileDesc;
{ Attachment descriptors }
end;
TMapiMessage = MapiMessage;

MapiMessage结构:
pMessage- >ulReserved:0
pMessage- >lpszSubject:邮件标题
pMessage- >lpszNoteText:邮件信息
pMessage- >lpszMessageType:邮件类型
pMessage- >DateReceived:接收时间
pMessage- >lpszConversationID:邮件所属的会话线程ID
pMessage- >flFlags:其值见表4

表4:MapiMessage结构中的flFlags
值 意义
MAPI_RECEIPT_REQUESTED 接收通知被申请。
客户端应用程序在发送消息时设置该项。
MAPI_SENT 邮件已被发送。
MAPI_UNREAD 邮件是“未读”状态。

pMessage- >lpOriginator:指向MapiRecipDesc结构,包含发件人信息。
pMessage- >nRecipCount:信件者数目。
pMessage- >lpRecips:指向MapiRecipDesc结构数组,包含接收者信息。
pMessage- >nFileCount:附件数量。
pMessage- >lpFiles:指向MapiFileDesc结构数组,
每一个结构包含一个文件附件。
ulReserved
Reserved;
must be zero.
lpszSubject
Pointer to the text string describing the message subject, typically limited to 256 characters or less. If this member is empty or NULL, the user has not entered subject text.
lpszNoteText
Pointer to a string containing the message text. If this member is empty or NULL, there is no message text.
lpszMessageType
Pointer to a string indicating a non-IPM type of message. Client applications can select message types for their non-IPM messages. Clients that only support IPM messages can ignore the lpszMessageType member when reading messages and set it to empty or NULL when sending messages.
lpszDateReceived
Pointer to a string indicating the date when the message was received. The format is YYYY/MM/DD HH:MM, using a 24-hour clock.
lpszConversationID
Pointer to a string identifying the conversation thread to which the message belongs. Some messaging systems can ignore and not return this member.
flFlags
Bitmask of message status flags. The following flags can be set:
MAPI_RECEIPT_REQUESTED
A receipt notification is requested. Client applications set this flag when sending a message.
MAPI_SENT
The message has been sent.
MAPI_UNREAD
The message has not been read.
lpOriginator
Pointer to a MapiRecipDesc structure containing information about the sender of the message.
nRecipCount
The number of message recipient structures in the array pointed to by the lpRecips member. A value of zero indicates no recipients are included.
lpRecips
Pointer to an array of MapiRecipDesc structures, each containing information about a message recipient.
nFileCount
The number of structures describing file attachments in the array pointed to by the lpFiles member. A value of zero indicates no file attachments are included.
lpFiles
Pointer to an array of MapiFileDesc structures, each containing information about a file attachment.
==============================================
难道用mapisendmail就没有这个功能吗?
 
I

iseek

Unregistered / Unconfirmed
GUEST, unregistred user!
貌似没有.
可以使用INDY啊.
 
顶部