Unanswered: getting subj from xp_readmail into another variable
I am having difficulty using xp_readmail in a stored procedure. I need to extract the subject line and message body from the email and then parse the subject line to identify some aspects and have the sp make some decisions about wether to store the email message body to a table. However, I am unable to get the subject line value from xp_readmail inot a variable I can manipulate. When I run the sp in query analyzer readmail returns the email values (so I know it is reading the emails) but the variable I am attempting to get th esubject into always comes back as null. What am I missing here??
The following is the last attempt at making this work: