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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Groupwise recipient.object error

Status
Not open for further replies.

egsp

Programmer
Dec 28, 2011
6
DE
I try to send emails but theres the error "recipient.object... unknown error".
The emial appears in GW but there is no recipient
I use GW in remote modus
I also used GWSend but there's the same problem...
here's the code:

objGroupWise = CREATEOBJECT("NovellGroupWareSession")
objAccount = objGroupWise.login
objMailBox = objAccount.Mailbox


objMessages = objMailBox.Messages
objMessage = objmessages.add("GW.MESSAGE.MAIL")
objRecipients = objMessage.recipients
objRecipient = objRecipients.add("blabla@googlemail.com")


objMessage.subject = "test"
objMessage.bodytext = "asasdasdaaa"


objmessagesent = objmessage.send
 
This is not my area of expertise, but a quick google leaves me to believe you have missed a step after adding your recipient:

Code:
objRecipient.RESOLVE



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I have already done that but it show me the same error and the debugger mark the line with the .resolve()

I believe that I configurated GW not correct, because there are several boards that show me that this code is correct
 
is it possible that the domain googlemail.com is wrong - could it be that it is throwing an error because of that.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
no
GW shows the mail with the correct subject and bodytext but instead of the recipient there are "$$$"
 
Some of the other code I looked at seemed to have the cose setting up the senders details too - is that required?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I found this in a german board, it's for VBA... and the user writes that it works...

Subject = "Registrierung"

'Anhang deklarieren
Attachment = ""

'Mailempfänger
Recipient = "Max.Mustermann@Musterstadt.de"
'Mail Hauptnachrichten Text
Bodytext = "Bitte nehmen Sie mich in der Updateverteiler auf."

'Übergabe an Groupwise
Set objGroupWise = CreateObject("NovellGroupWareSession")
Set objAccount = objGroupWise.Login
Set objMailBox = objAccount.MailBox
Set objMessages = objMailBox.Messages
Set objMessage = objMessages.Add("GW.MESSAGE.MAIL", "Draft")
Set objRecipients = objMessage.Recipients
Set objRecipient = objRecipients.Add(Recipient)
Set objAttachments = objMessage.Attachments

'musste deaktivieren da kein Anhang definiert
Set objAttachment = Nothing

With objMessage

.Subject = Subject

.Bodytext = Bodytext

End With

Set objMessageSent = objMessage.Send
 
The main difference I see there is the specification of a folder "draft" when creating the message - gotta be worth trying.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
its automatically set to "draft" but I already try that for sure
I really believe that the problem is because of the "remote mode" or any other configuration
 
could be - sorry I can't help more!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I see there is the specification of a folder "draft" when creating the message

I can't say about Groupwise, but Redemption creates emails in the Draft folder and then issues a Send in order to get around the Outlook SP-2 Security nuisance.

Just an FYI...

Good Luck,
JRB-Bldr
 
One thing that comes to mind is that you don't check any return values.
I have similar code that has worked for years, something like this:

oGroupWise = createobject("NovellGroupWareSession")
oAcct = oGroupWise.Login("")
IF TYPE('oAcct')<>'O' OR ISNULL(oAcct)
WAIT WINDOW 'Could not use GroupWise...' NOWAIT
RETURN .F.
ENDIF
oMessages = oAcct.MailBox.Messages
oMessage = oMessages.Add() && Add a new message with oMessage
recipkomma =OCCURS(',',lcRecip)
WITH oMessage
.Subject = lcSubject && Define message subject
.BodyText = lcBodyText+' ' && Define body text
recipant=ALINE(MyArray, lcRecip, .T., ",")
FOR recip_i= 1 TO recipant
.Recipients.Add(ALLTRIM(MyArray[recip_i]))
ENDFOR
*!* .Recipients.Add(lcrecip)
IF TYPE('lcAttach')='C' AND !EMPTY(lcAttach)
attachant=ALINE(MyArray, lcAttach, .T., ",")
FOR attach_i= 1 TO attachant
.Attachments.Add(MyArray[attach_i])
ENDFOR
ENDIF
.Send() && Send Message
ENDWITH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top