Closed tlecomte closed 7 years ago
After a closer look, it seems that the usage of Substring was not right according to the intent of the code (Substring(x) takes what is after x, not before). Using a Regex makes it easier to define the prefix.
Thanks for the pull request.
Hi Sicos1977
Here is a pull request to fix an error that occurs when a message subject is shorter than 5 characters. In that case, the following exception was obtained:
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. Parameter name: startIndex at System.String.Substring(Int32 startIndex, Int32 length) at MsgKit.Email.SetSubject() in ...\MsgKit\Email.cs:line 265 at MsgKit.Email..ctor(Sender sender, String subject) in ...\MsgKit\Email.cs:line 102
Thanks for looking at this pull request, and thanks for MsgKit!