Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send email through Groupwise

Status
Not open for further replies.

BongoB1

Programmer
Jul 26, 2001
26
0
0
US
In his message (thread1251-1104909) jsams asks about generating an email with an attachment using Groupwise. Anymore thoughts about this question?

jsams wrote the following:
Listed below is a short program to create an email with and attachment in a Novell Groupwise 6.5 environment.

It creates and sends the email OK, but I need it to popup the email draft to allow the user to review before sending. What am I missing, or need to change?

oGroupWise = CREATEOBJECT("NovellGroupwareSession")
oAccount = oGroupWise.Login
oWorkfolder = oAccount.WorkFolder
oMessages = oWorkfolder.MESSAGES
oMessage = oMessages.ADD("GW.MESSAGE.MAIL")
oMessage.FromText = ALLTRIM("from@some_dom.com")
oMessage.Subject = ALLTRIM(" My subject line text. ")
oMessage.BodyText = ALLTRIM(" My email body text. ")
oMessage.Attachments.Add("testdoc.pdf")
recip = oMessage.Recipients.Add("to@some_dom.com")
recip.RESOLVE
oMessage.SEND
RELEASE oGroupWise

Thanks,
John
 
Create a foxpro project with a main program and a form. On the form create buttons and edit and/or text box's plus buttons for send, exit etc. You can also expand on adding recipients and moving the resolve to an 'add recipients button' but its up to you how elaborate you want to reinvent the wheel. The focus as per your words is to stay simple.

Each text/edit box will have its controlsource set to a form level variable such as lcFromText, lcSubject, etc.

FORM INIT:
ThisForm.oGroupWise = CREATEOBJECT("NovellGroupwareSession")
ThisForm.oAccount = oGroupWise.Login
ThisForm.oWorkfolder = oAccount.WorkFolder

ThisForm.lcFromEmail=""
ThisForm.lcSubject = ""
ThisForm.lcBodyText = ""
ThisForm.lcAttachments = ""
ThisForm.Recipients = ""


SEND BUTTON:
ThisForm.oMessage = oMessages.ADD("GW.MESSAGE.MAIL")
ThisForm.oMessage.FromText = ALLTRIM(ThisForm.lcFromEmail)
ThisForm.oMessage.Subject = ALLTRIM(ThisForm.lcSubject)
ThisForm.oMessage.BodyText = ALLTRIM(ThisForm.lcBodyText)
ThisForm.oMessage.Attachments.Add(ThisForm.lcAttachments)
recip = ThisForm.oMessage.Recipients.Add(ThisForm.Recipients)
recip.RESOLVE
ThisForm.oMessage.SEND


FORM UNLOAD:
Clear Events
RELEASE ThisForm.oGroupWise




Regards,

Rob
 
The main question here was about getting Groupwise to popup the message for review before sending. I can get Outlook to do this, but I'm missing the same thing that JSAMS is asking about when it come to Groupwise. I would think that it is simply a matter of some missing parameter.
 
Thanks for the links. I'll check them out.
 
On page 69 of the developers guide it talks of a method called 'ItemOpen' which may be what you are looking for.

Regards,

Rob
 
If you have access to experts exchange here is a link to someone with accepted answer:

Here is a snipet of the answer code in VBA from the article which your attention should be towards the 'itemopen' portion, could easily be converted to foxpro:

'open connection to GW
Set oApp = CreateObject("NovellGroupWareSession")
Set oAcct = oApp.Login("", "")
Set oFolders = oAcct.AllFolders
dtMsg = 0
'loop over folders until we get the WIP
For Each oFolder In oFolders

If oFolder.Name = "Work In Progress" Then
Set oMessages = oFolder.Messages
'loop over all the msg's in there
For Each oMessage In oMessages
If oMessage.CreationDate > dtMsg Then
dtMsg = oMessage.CreationDate
MyMsgID = oMessage.MessageID
End If
Next
'Open the new message to view it
Set vCommander = CreateObject("GroupWiseCommander")
ParamStr = "ItemOpen(""" + MyMsgID + """)"
iRet = vCommander.Execute(ParamStr, sResult)
End If
Next




Regards,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top