When creating an ActiveSync scenario, if you choose as one of the activities the option to create an email, you may notice that it is only sent once.
The second time the scenario runs, the create mail activity fails with a message in the history stating that the message has previously been sent.
Below we will add a unique value to the subject to allow GSX Monitor to send the same message multiple times.
- The message was already sent in a previous request
or the request contains a message ID that was already used in a recent message.
- The server determined this by remembering the values of the ClientId element (section 184.108.40.206) from the last few sent messages.
How to Solve the Issue
The scenario is using ActiveSync commands to communicate with the Traveler server and synchronize folders. The server will return a response code once it has processed the request. With Traveler 220.127.116.11, before the server sends the message, it checks the ClientId and whether this message was already sent. This is to prevent sending multiple copies of the same message, however, that is what we are trying to do with the scenario.
Since Traveler 18.104.22.168 and onwards, the status code returning from the create mail activity is ActiveSync Status 118: Message Previously Sent.
ActiveSync Status 118:
- The message was already sent in a previous request or the request contains a message ID that was already used in a recent message. The server determined this by remembering the values of the ClientId element (section 22.214.171.124) from the last few sent messages.
The server has correctly identified that it has already sent this message quite recently. We will need to create a unique element in the message so it is not considered the same message.
To do this, we are going to add a variable to the subject that will create a unique number making the message unique.
Creating a unique subject line
- In GSX Monitor, select Scenario > ActiveSync Scenario...
- Edit the scenario that is failing to send a second email.
- In the Scenario tab, locate the subject field and append the value $unid to the subject line:
- Close the wizard and run the scenario.
With the unique id added, the message is sent repeatedly: