Turn off message forwarding for user accounts

If you included an email web service when you generated your client proxy, to turn off 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 off message forwarding for one user account, you can use the single-object EnableUserMailRedirection() method .
Before you begin: Retrieve the userIDs integer array for the user accounts that you want to turn off message forwarding for.
  1. Invoke the enableUsersMailRedirection method.
    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.