catgirl78
March 17th, 2001, 07:31 PM
i have the following codes:
Private Sub Command1_Click()
Dim msg As String
Screen.MousePointer = vbHourglass
msg = "This is a test email"
With Me
MAPISession.SignOn ' use current user'
MAPISession.NewSession = True
Do While .MAPILogOn.SessionID = 0
DoEvents ' need to wait until the new session is created
Loop
Call SendToEmail("tracer@kkng.fsnet.co.uk", msg)
.MAPILogOn.SignOff
End With
Screen.MousePointer = vbNormal
End Sub
Private Sub SendToEmail(ByVal Email As String, ByVal msg As String)
With MAPIMessages
'create a new message and address it
MAPIMessages.SessionID = MAPISession.SessionID
.SessionID = MAPILogOn.SessionID
MAPIMessages.Compose
MAPIMessages.RecipDisplayName = Email
MAPIMessages.AddressResolveUI = True
MAPIMessages.RecipAddress = "smtp:" & Email
MAPIMessages.MsgSubject = "VB GENERATED E-MAIL"
MAPIMessages.MsgNoteText = msg
'if True then open Netscape and wait, if false then sends to Eudora.
MAPIMessages.Send False
End With
End Sub
when i run the program, it comes with a error..."method or data member not found"...
please help....
Private Sub Command1_Click()
Dim msg As String
Screen.MousePointer = vbHourglass
msg = "This is a test email"
With Me
MAPISession.SignOn ' use current user'
MAPISession.NewSession = True
Do While .MAPILogOn.SessionID = 0
DoEvents ' need to wait until the new session is created
Loop
Call SendToEmail("tracer@kkng.fsnet.co.uk", msg)
.MAPILogOn.SignOff
End With
Screen.MousePointer = vbNormal
End Sub
Private Sub SendToEmail(ByVal Email As String, ByVal msg As String)
With MAPIMessages
'create a new message and address it
MAPIMessages.SessionID = MAPISession.SessionID
.SessionID = MAPILogOn.SessionID
MAPIMessages.Compose
MAPIMessages.RecipDisplayName = Email
MAPIMessages.AddressResolveUI = True
MAPIMessages.RecipAddress = "smtp:" & Email
MAPIMessages.MsgSubject = "VB GENERATED E-MAIL"
MAPIMessages.MsgNoteText = msg
'if True then open Netscape and wait, if false then sends to Eudora.
MAPIMessages.Send False
End With
End Sub
when i run the program, it comes with a error..."method or data member not found"...
please help....