Sunday, February 19, 2012

CreateMHTMLBody retuns "Invalid syntax" error

Hi,

I want to add html as body of my mail message. I added CreateMHTMLBody method in my SQL code.

Syntax I used is

Exec @.hr=sp_oamethod @.imsg,'CreateMHTMLBody',NULL,@.MsgFile,0,'',''

This syntax is working fine on my system but whem I implement this on production it gives error.

Needed ASAP as I have to implmenet this on my production server today.

Thanks

GAurav

What is the error message you are getting|||are you running the same version of cdosys.dll on dev and prod?|||

Why use CDO when you have sql database mail.

CreateMHTMLBody expects 4 parameters (url, cdomhtmlflags, user, pwd) so check your @.MsgFile.

|||Check the required COM DLLs are registered properly on your server.|||

Using SQL database mail you can't send the HTML mails where message body is created from the HTML file

And my syntax is correct as it is working perfectly fine on my development env. but it is not working on production

|||

Yes COM dll is properly registerde and it is sending Textbody mail. But when I use this CreateMHTMLBoby it gives me above error. And my code and syntax is also correct as it is working fine on development env.

Thanks

No comments:

Post a Comment