Hello Anavim
This example I found on the web. its written by Jim Griffith
Send Mail From VB5
If Microsoft Outlook is installed, you have an easy way to
send e-mail from VB5. To use this technique with VB3,
remove the With construct and fully qualify each object
property reference:
And here is another exampleCode:Dim olapp As Object Dim oitem As Object Set olapp = CreateObject("Outlook.Application") Set oitem = olapp.CreateItem(0) With oitem .Subject = "VBPJ RULES" .To = "MONTEZUMA;other Names;" .Body = "This message was sent from VB5" .Send End With
Send E-mail with attachment
using MAPI.
Use the 2 mapi objs - mpmMessage & mpsSession
Here is the code:
This code I have tried, and it works for me.Code:mpsSession.SignOn mpmMessage.SessionID = mpsSession.SessionID mpmMessage.Compose mpmMessage.RecipAddress = "[email protected]" 'or txtAddress.text mpmMessage.MsgSubject = "xxxxxx" 'txtMessage.text mpmMessage.MsgNoteText = "Thank you" mpmMessage.AttachmentPathName = App.Path & "\xxx.txt" mpmMessage.Send False
I hope this is what you were asking for![]()




Reply With Quote