/ Forums / Advansys Formativ / Creating Solutions with Formativ / Creating Email in Proxy Account without UI

  • Creator
  • #4044


    i want to create a email without UI in a proxy account. i used the sample from programmers guide.

    Sub Main(Client, GWEvent)

    Dim objDraft
    Dim objEmail
    Dim objRecipient

    ' Create a draft email message
    Set objDraft = GroupWise.Account.MailBox.Messages.Add(4)

    ' Add a single recipient - ourself
    objRecipient = objDraft.Recipients.Add(objDraft.Sender.EmailAddress,,0)

    ' Add some properties
    objDraft.Subject = "This was created using Formativ"
    objDraft.BodyText.PlainText = "This is the body text of the email message"

    ' Send the email by calling the send method
    Set objEmail = objDraft.Send

    End Sub

    Yes it created a email, but not in the proxied account!

    How can i realize it?

    Thanks …


  • Author
  • #6933
    Support 1

    Thank you for your query.

    The technique required to create email in a proxy account is similar to that from your previous post on EmailAddress from ProxyAccount.

    Here is an example:

    ' This example assumes the GroupWise client has been proxied to another account.
    Sub Main(Client, GWEvent)
      dim oAccount
      dim oDraft
      dim oSent
      set oAccount = Client.ClientState.CurrentAccount
      set oDraft = oAccount.WorkFolder.Messages.Add("GW.MESSAGE.MAIL", fgwDraft)
      call oDraft.Recipients.Add(oAccount.Owner.EmailAddress, "NGW", fgwTo)
      oDraft.Subject.PlainText = "This was created using Formativ"
      oDraft.BodyText.PlainText = "This is the body text of the email message"
      set oSent = oDraft.send
      set oSent = nothing
      set oDraft = nothing
      set oAccount = nothing
    End Sub

    I hope this helps.

    Advansys Support

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.