January 19, 2007 at 12:56 pm
Greetings all;
Here is my issue. I have created a procedure to parse and send an email confirmation from an order entry process. It all works fine as long as my html message doesn't go beyond 8000 characters. My first issue was getting around the 8000 character limit. What I did was break up the message into 3 separate 8000 varchar variables.
The stored procedure that I modified is sp_SMTPemail, accepting the 3 varchar fields vs. the 1 "@Body" field.
I am having difficulty setting the 3 varchar fields into the following statement:
EXEC @hr = sp_OASetProperty @message, 'HTMLBody',< something happens here >
SOOOOOOOOOO.... after pondering that a bit I thought I'd look to see if I might be able to send a file in stead. I found this:
EXEC @hr = sp_OASetProperty @message, 'CreateMHTMLBody','file://
I have not been able to get this to work... not at all.
Does anyone have any solution for this problem?
Kurt
Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY
http://www.linkedin.com/in/kurtwzimmerman
January 22, 2007 at 8:00 am
This was removed by the editor as SPAM
January 23, 2007 at 7:53 am
I'm wondering if I can't find my answer on this Forum, is there another Forum I can post my question?
Thanks.
Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY
http://www.linkedin.com/in/kurtwzimmerman
January 23, 2007 at 3:33 pm
Check out this thread:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=337493#bm337593
This person is trying to do what you are trying to do.
SQL guy and Houston Magician
January 25, 2007 at 11:57 am
Robert;
Actually that link provided me great help. However, I still had some issues with the HTML.
Here is the process: I produced an automated mail-merge conformation email process when ever an ad was purchased. The email template was created in Front Page (for the purpose of someone with no knowledge in formatting HTML docs) could modify it. So far so good. In the HTML document contained single quotes. I simply replaced the single quotes to double quotes.
declare @singlequote varchar(1)
declare @doublequote varchar(2)
set @singlequote = char(39)
set @doublequote = @singlequote + @singlequote
Once I loaded the portions of text into separate varchar chuncks I simply replaced the single quotes with double quotes something like this...
set @Body1 = REPLACE(@Body1, @SingleQuote, @DoubleQuote)
This resolved most of my problems insuring that I can pass the HTML text to the email stored procedure.
Bob's post listed above helped me get the proper syntax to taking the body pieces into the text field in the stored procedure.....
So, finally, I have something working.
Just want to say thanks to Bob...
Kurt Zimmerman
Lead Programmer
Yorktown ePublishing
Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY
http://www.linkedin.com/in/kurtwzimmerman
January 25, 2007 at 12:05 pm
I'm glad you're up and running!
SQL guy and Houston Magician
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply