Add the mapi controls to your prog:
Code:' //Program using email functionality (MAPI control)\\ ' ------------------------------------------------------------------------- ' | Whats actually happens is that the program sends the new email | ' | message to the user's Outbox, and the outbox is usually set to email | ' | automatically. | ' ------------------------------------------------------------------------- Option Explicit Private Sub Command1_Click() MAPISession1.DownLoadMail = False ' Indicating we don't want to download MAPISession1.SignOn ' Start new MAPI Session, sign on to MS Exchange email system MAPIMessages1.SessionID = MAPISession1.SessionID MAPIMessages1.MsgIndex = -1 ' To compose a new email message MAPIMessages1.Compose MAPIMessages1.Send True ' Send email MAPISession1.SignOff ' Sign off the MAPI session End Sub Private Sub Command2_Click() MAPISession1.DownLoadMail = True ' Alow for waiting email to be download into the Inbox MAPISession1.SignOn ' Start new MAPI Session, sign on to MS Exchange email system MAPIMessages1.SessionID = MAPISession1.SessionID MAPIMessages1.Fetch ' Used to create a message set (Reach the emails) MAPIMessages1.MsgIndex = 0 Text1.Text = MAPIMessages1.MsgNoteText MAPISession1.SignOff ' Sign off the MAPI session End Sub




Reply With Quote