Quick Tip: RichMailSend error "Length cannot be less than zero"

Quick Tip: RichMailSend error "Length cannot be less than zero"

I've come across an error when using the RichMailSend action of the Rich Mail extension which I believe deserves a quick post to avoid having people wasting time trying to figure it out the next time it happens.

I was using the Rich Mail extension to send emails in an Espace.

All actions like the HTTPGet and RichMailCreate where successfull, but when I called the RichMailSend I got an error I could not understand:

"Length cannot be less than zero.
Parameter name: length"

The issue has to do with the value used in the Server parameter of the RichMailSend action.
In my case I was using a site property which contained the email server name. What I found out was that this site property has an "extra" carriage return after the site property value, that was ultimately causing this error.

To solve this I simply had to:

1) Go to the Service Center console
2) Select the eSpace
3) Click on the the tenant to access the site properties.
4) Select the property that containes the mail server
5) Remove the extra carriage return and press the Apply button.
6) Click the "Return to eSpace" button to go back to the eSpace page
7) Click the "Redeploy Tenant " button to make the changes effective

Hope this helps

I experienced the same error when trying to send an email with an empty body.