Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Problem with MAPI


Problem with MAPI

Author
Message
rjng
rjng
Forum God
Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)Forum God (942 reputation)

Group: Forum Members
Posts: 6, Visits: 8
Hi,



I used a example of planet source code for send email for MAPI... it works perfectly in the first email that I send, however, when a click again in the send button, with a different message to other email, I have an error - I just get to send one message... to send two, I need close the program and open it again to send...

I'm using this code:



-----------------------------------------------------------------------------

On Error GoTo mailerr: 'go to the error handling bit If there is an error

MAPISession1.SignOn 'sign on





If MAPISession1.SessionID <> 0 Then 'signed on





With MAPIMessages1

.SessionID = MAPISession1.SessionID

.Compose 'start a new message

.AttachmentName = Text5 'attachment name

.AttachmentPathName = Text4 ' attachment path (get this from the text box or a default dirrectory)

.RecipAddress = Text1 'set the receiver's email To the one they specified (again, text box or a default address)

.MsgSubject = Text2 'set the subject

.MsgNoteText = Text3 'message text

.Send False 'don't display a dialog saying it was sent



End With

Exit Sub

End If

mailerr: 'error handling

MsgBox "Error " & Err.Description



-----------------------------------------------------------------------------------------



What a problem?



Thanks
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search