Novell is now a part of Micro Focus

I have made a program in GroupWise and...

Articles and Tips: qna

01 Oct 2000


Q.

I have made a program in GroupWise and within this program there is a possibility of sending information with e-mail. Normally I do this with Visual Basic 6 and the MAPI mechanism, but this has been problematic. So now I am trying this with the GroupWise API object. When a user presses the e-mail button within my program, I want a new e-mail message to appear on the screen with the information from my program (subject, bodytext, and attachments). I have two questions: (1) Is it better to use the API or the token mechanism? and (2) How can I send a CC copy?

A.

The answer to your first question is, it depends on how customizable you want your send functionality to be. If you would like a different look and feel to the send e-mail portion of your application, you should use the object API. If you would like to have the same popup that you see in GroupWise, the tokens are very helpful.

Actually, you can still pop up your own form with the SendMail() token. Tokens are essentially the same as the object API, except that they are client driven, which means that tokens require the GroupWise client to be up and running (this is especially helpful when writing a C3PO).

As for your second question, the SendMail() call gives you optional CC() and BC() parameters.

Here's the object API part of sending an e-mail:


'Get Message Object from the messages collection
Set oNewMessage = oMessages.Add("GW.MESSAGE.MAIL")
'Get Recipients collection from the message object
Set oRecipients = oNewMessage.Recipients
'Add each recipient
Set oRecipient = oRecipients.Add("devforums@novell.com",
"NGW", egwTo)
'Add a CC recipient
Set oRecipient = oRecipients.Add("devforums@novell.com",
"NGW", egwCC)
'Checking to see if text boxes are populated.
If tSubject.Text = "" Then
tSubject.SetFocus
MsgBox ("Please type in a subject")
End If
If tMessage.Text = "" Then
tMessage.SetFocus
MsgBox ("Please type in a message")
End If
'Add Subject to Message object
oNewMessage.Subject = tSubject.Text
'Add Message to Bodytext of Message object
oNewMessage.BodyText = tMessage.Text
'Send message
oNewMessage.Send

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates