mreich1 Absent Member.
Absent Member.

resolving recipients of mail leads to "User not found" error


I'm developing with VB.NET and I have this problem:
Executing this code

Dim appl As GroupwareTypeLibrary.Application = New GroupwareTypeLibrary.Application

Dim acct As GroupwareTypeLibrary.Account = appl.Login

Dim mailbx As GroupwareTypeLibrary.Folder = acct.MailBox

Dim msgs As GroupwareTypeLibrary.Messages = mailbx.Messages

Dim msg As GroupwareTypeLibrary.Message = msgs.Add("GW.MESSAGE.MAIL")

Dim rpts As GroupwareTypeLibrary.Recipients = msg.Recipients

Dim rpt As GroupwareTypeLibrary.Recipient = rpts.Add("")

msg.Subject.PlainText = "subject"
msg.BodyText.PlainText = "body"

leads to an error when I try to use either "rpts.resolve" or "msg.send"
The error message is "User not found".

I have no idea why it's not working because it's basically the same as some sample code I found but I'm running out of ideas.
Can anyone help me?

Thank you in advance!
Labels (1)
2 Replies
s_vogel Absent Member.
Absent Member.

Re: resolving recipients of mail leads to "User not found" e

I have had a lot of trouble with setting the recipient via the Object API and fell back to using the GroupWise Commander Tokens. There I compose a Mail via NewMail(), TestSetMessage() TestSetTo() etc.

I need to have a deeper look into that too.
s_vogel Absent Member.
Absent Member.

Re: resolving recipients of mail leads to "User not found" e

Allright i dug down the rabbit hole a bit. Here is my sample code. It's C# but can be transitioned to VB pretty easy:

var GroupWise = new GroupwareTypeLibrary.Application();
var Account = GroupWise.Login();
var Mailbox = Account.MailBox;
var Messages = Mailbox.Messages;
var Message = Messages.Add("GW.MESSAGE.MAIL", MessageBoxTypeConstants.egwDraft);
var Recipient = Message.Recipients.Add("", "Internet", AddressTargetTypeConstants.egwTo);

Message.Subject.PlainText = "Test";
Message.BodyText.PlainText = "TestBody";

Messages.AddExistingMessage(Account.Owner.DisplayName, Account.Owner.EMailAddress, "", DateTime.Now, MessageBoxTypeConstants.egwDraft, MessageStatusConstants.egwMessageStatusDefault, MessagePriorityConstants.egwNormal, MessageSecurityConstants.egwDefaultSecurity, Message);

So you create a Message object in your Mailbox and set it up as the documentation says. Then you resolve the recipients on the message object (if they are external use some string like "internet" to get them resolved. For internal (GW domain users use "NGW"). then Add the Message object to the synnchronized collection via AddExisitingMessage() and the recipients are in the Mail Object.
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.