Skip to main content

Hi all,

I am trying to send emails by using an outlook object, I am facing the following problem:

I want to use the SendUsingAccount property which allows me to sellect the sender account:

In brief my program looks like this:

77 H-Application handle of @Application.
77 H-Accounts handle of @Accounts.
77 H-Account handle of Account.
77 W-Var-_NameSpace handle of @_NameSpace.

77 OUTLOOK-HANDLE HANDLE OF APPLICATION.
77 MAIL-HANDLE HANDLE OF MAILITEM.

CREATE APPLICATION OF OUTLOOK HANDLE IN OUTLOOK-HANDLE

MODIFY OUTLOOK-HANDLE, CREATEITEM (OLMAILITEM) GIVING MAIL-HANDLE

 inquire OUTLOOK-HANDLE @Session in W-Var-_NameSpace
inquire W-Var-_NameSpace @Accounts in H-Accounts

modify H-Accounts @Item (2) Returning H-Account

MODIFY MAIL-HANDLE @SendUsingAccount = H-Account

This command seems to do nothing, always the primary/default account is used.

I searched many forums and it seems that (by using regular VB code) the correct command is:

set mail_object.SendUsingAccount=account_object

I believe "MODIFY MAIL-HANDLE @SendUsingAccount = H-Account" is the same with "mail_object.SendUsingAccount=account_handle"

How can I do it?

Many thanks


#Outlook