Archived Forum Post

Index of archived forum posts

Question:

blank email body using mht sql server

Dec 12 '16 at 09:33

Hi,

I have copied pasted text from https://www.example-code.com/sql/mht_emailWebPage.asp

But I get a blank email..

Please help!


Answer

It's likely the string returned by the mht.GetEml method is longer than 4000 chars.

    DECLARE @emlStr nvarchar(4000)
    EXEC sp_OAMethod @mht, 'GetEML', @emlStr OUT, 'http://www.bonairefishing.com/'

See if you can declare the nvarchar larger. If not, then Chilkat is making a note to add alternative methods to return the string in a Chilkat.StringBuilder object instead. This will eliminate the issues with long strings in SQL. The new version that includes this new method will be out in a few weeks. I can provide a pre-release with sample prior to that, but not immediately because of other unrelated work that needs to be finished first..

(It is also possible to get string results in a temp table..)


Answer

Thanks for your answer.

I tried varchar(8000) and infact the same page http//www.bonairefishing.com did not work.

Now I am loading it as EML and then sending it.