Turn on message forwarding for user accounts

If you included an email web service when you generated your client proxy, to turn on message forwarding capabilities for user accounts, you can use the multi-object EnableUsersMailRedirection() method. You must use the email web service for the email platform that is installed in your environment. To turn on message forwarding for one user account, you can use the single-objectEnableUserMailRedirection() method.
Before you begin: Retrieve the userIDs integer array for the user account IDs that you want to turn on message forwarding for.
  1. Invoke enableUsersMailRedirection.
    1. If your organization uses the Microsoft® Exchange messaging platform, use the email web service for Microsoft Exchange.
      EnableUsersMailRedirection request = new EnableUsersMailRedirection();
      request.userIds = userIDs;
      request.enableMailRedirection = true;
      EnableUsersMailRedirectionResponse response = emailExchangeWebService.enableUsersMailRedirection(request);
      EnableUsersMailRedirectionResult result = response.returnValue;
      
    2. If your organization uses the IBM® Lotus® Domino® messaging platform, use the email web service for IBM Lotus Domino.
      EnableUsersMailRedirection request = new EnableUsersMailRedirection();
      request.userIds = userIDs;
      request.enableMailRedirection = true;
      EnableUsersMailRedirectionResponse response = emailDominoWebService.enableUsersMailRedirection(request);
      EnableUsersMailRedirectionResult result = response.returnValue;
  2. Check the result for errors and handle any errors.
    if( result.enableUserMailRedirectionReturnStatus.code != EnableUserMailRedirectionReturnStatusEnumType.SUCCESS )
    {
         // handle any errors
    }

Was this information helpful? Send us your comments.