Send SMTP Mail Message - System exception.The specified string is not in the form required for a subject


#1

Hello,
I wonder if I can get some advice here. My automation (placed in a framework) is supposed to send an email in some circumstances, however, from time to time the activity “Send SMTP Mail Message” breaks - the log then states: “System exception.The specified string is not in the form required for a subject.” The message subject is: “File " +locationPath +” has not been located." where “locationPath” is a variable storing the file path. What could be the reason? Thank you in advance for your help!


#2

Hi @PAD,

The subject may require string format and the file path may contain “”, convert the filepath variable to string and try again.

Regards,
PD


#3

Here were my thoughts.
There could be a character limit for the Subject or an invalid character in the file path.
If you output the Subject you use right before the error occurs, then you can take that string and hardcode it and figure out what’s causing the error.

Or provide what the string is and maybe we can identify the issue.


#4

Hi @PD2,
The variable locationPath is in a string format already.


#5

@ClaytonM,
which character would be invalid for a subject? I have tested the string length and normally I can email this file path together with the other parts of the coded subject to myself.


#6

Well if you are looping through many locationPaths, then you would want to check that the locationPath has a value right before the error occurs, and see what value it was. If you know what string is causing the error, that will help identify the issue. It’s probably something simple.