ThisMailSession
= CREATE mailsession creates a mailsession Object for us.
The next few lines log the
mail session on to your MAPI and compare the results of the
mailLogon function call to MailReturnSuccess!:
if
ThisMailSession.mailLogon(MailNewSession!) <> mailReturnSuccess! then
messagebox("Error logging onto mail session","This logon
&
attempt failed for the reason stated by the MAPI client. Please
&
fix it and try again...")
close(parent)
end if
The next sequence loads
appropriate properties with appropriate data types, dispatches the
email, and destroys the mailsession object.
Note that ThisMailMessage is
a data structure which contains properties of internet mail: Recipient,
Subject, and NoteText.
Note that mailSend is a
method of ThisMailSession, so is mailLogoff.
ThisMailRecipient.Name = EmailAddress
ThisMailMessage.Recipient[1] = ThisMailRecipient
ThisMailMessage.Subject = "!*!*Testing from 9009*!*!"
ThisMailMessage.NoteText = MessageToSend
ThisMailSession.mailSend(ThisMailMessage)
ThisMailSession.mailLogoff()
DESTROY ThisMailSession
The email message typed into
mle_messagetext is stored in the Instance Variable MessageToSend whenever
the user changes the Text property of the control.