Answers
Mar 04, 2009 - 08:05 PM
Could you please post a snip of the code you're using, especially the string your wanting to use for the subject as well as the construction of you mail message object?
It would make it much easier to assist you.
Thanks!
Ric
It would make it much easier to assist you.
Thanks!
Ric
Mar 05, 2009 - 12:52 AM
The problem is that it's running through a range of different emails it sends and right now I haven't debugged to the point where i found out which one is giving the error.
I was just a bit surprised, since I didn't know there were characters that could trigger this for an email subject.
I was just a bit surprised, since I didn't know there were characters that could trigger this for an email subject.
Mar 05, 2009 - 03:24 AM
Oh, yeah, dust...there's ways that automatic stuff can get fubar'd.
Let's say you're getting the subject line from the database and you run into a NULL value. Well, if they're not converted to string.Empty or "" then you could potentially see the error you're describing.
Here's another scenario - your database holds something like 'Dwayne "The Rock" Johnson' for the value. Completely valid data, but those additional quotes within the value would inadvertently terminate the current string right after 'Dwayne ' and starting with 'The' you would have an unrecognized value.
I'm sure there are a few other reasons why this could happen, but those are a couple I've run across myself - especially with "blind" systems where people could register for a forum, or a subscription-based site.
Sadly, it's hard to prepare for the varying levels of stoooopid that the ordinary user can introduce into a perfectly good system. :)
I hope you're doing well - it's been quite a while since I've had time to spend on Quomon, but I'm glad to see it's thriving!
Let me know if I can help you out any further...I'd be happy to!
Take care,
Ric
Let's say you're getting the subject line from the database and you run into a NULL value. Well, if they're not converted to string.Empty or "" then you could potentially see the error you're describing.
Here's another scenario - your database holds something like 'Dwayne "The Rock" Johnson' for the value. Completely valid data, but those additional quotes within the value would inadvertently terminate the current string right after 'Dwayne ' and starting with 'The' you would have an unrecognized value.
I'm sure there are a few other reasons why this could happen, but those are a couple I've run across myself - especially with "blind" systems where people could register for a forum, or a subscription-based site.
Sadly, it's hard to prepare for the varying levels of stoooopid that the ordinary user can introduce into a perfectly good system. :)
I hope you're doing well - it's been quite a while since I've had time to spend on Quomon, but I'm glad to see it's thriving!
Let me know if I can help you out any further...I'd be happy to!
Take care,
Ric
Mar 05, 2009 - 08:53 AM
Thanks, Ric, I'm doing good and it's good to see you here again and always a pleasure to read your responses.
I figured out what the issue was, by doing what they recommend here: http://blog.dotsmart.net/2008/02/15/s...
message.Subject = subject.Replace('\r', ' ').Replace('\n', ' ');
I don't know how that carriage-return got in the subject, but this solved it :)
I'll give you some points for getting me in the right direction and pointing out some other things that i wasn't taking into account either.
I figured out what the issue was, by doing what they recommend here: http://blog.dotsmart.net/2008/02/15/s...
message.Subject = subject.Replace('\r', ' ').Replace('\n', ' ');
I don't know how that carriage-return got in the subject, but this solved it :)
I'll give you some points for getting me in the right direction and pointing out some other things that i wasn't taking into account either.
Add New Comment