小弟用MAPI發Mail可以了,可是只能發純文字,<br>現在想要發 HTML格式信件,這樣我就可以將純文字表格化,<br>請教各位大大!
http://www.vbqa.com/discuss/vb.old/read.asp?id=30304
可能有點誤會,我用 VB6中的專案的『使用元件』的mapi, 包含了兩個: MapiSession、MapiMessages, 這兩個物件中我找不到相關的屬性‧ 你回覆的討論文章我看了,還是沒頭緒‧ 明天我把程式Post上來,請大家幫忙!thanks.
mapi程式碼如下(取自知城書局):此程式將使用 outlook express來發信‧ Private Function MAPI_SendMail() As Boolean On Error Resume Next SessionID = 0 MAPISession1.DownLoadMail = False MAPISession1.LogonUI = False MAPISession1.SignOn MAPISession1.NewSession = True MAPIMessages1.SessionID = MAPISession1.SessionID MAPIMessages1.Compose MAPIMessages1.MsgOrigAddress = Text1.Text MAPIMessages1.RecipAddress = Text2.Text MAPIMessages1.MsgSubject = Text3.Text MAPIMessages1.MsgNoteText = Text5.Text If Trim(Text4.Text) <> "" Then If Dir(Text4.Text) <> "" Then MAPIMessages1.MsgNoteText = MAPIMessages1.MsgNoteText & vbCrLf MAPIMessages1.AttachmentPosition = Len(MAPIMessages1.MsgNoteText) - 1 MAPIMessages1.AttachmentPathName = Text4.Text End If End If MAPIMessages1.Send (False) SessionID = MAPISession1.SessionID If MAPIErrors.mapSuccessSuccess Then ' End If ActionError: Exit Function End Function
沒辦法‧ 最後我還昰用 outlook 解決!
最後找到mapi不支援html信件的說明了 http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&oe=UTF-8&th=ede2e1e17aad9973&rnum=29 我在這篇的回答是錯的,在此更正http://www.vbqa.com/discuss/vb.old/read.asp?id=22836 對bd致上最深的歉意
不用那麼客氣啦!大家互相研究‧ 我現在又弄了個用 WinSock的程式,發 HTML 格式信件沒問題, 還有點小小修正‧