West Wind Internet and Client Tools
wwSMTP problems sending htm files in message body
Gravatar is a globally recognized avatar based on your email address. wwSMTP problems sending htm files in message body
  Steve Howie
  All
  Jun 29, 2022 @ 08:15pm

We are converting our systems from old cdo messaging to use wwSMTP with Office365. Everything is working wonderfully with one exception. We have some automated reports that read generated html files and issue oCDO.CreateMHTMLBody() to read in the file. This embeds the html into the message.

I have tried running a simple filetostr() of the .htm file, but get errors from the message object of invalid characters. Is there an equivalent method to send html as .CreateMHTMLBody?

I will work up a sample .htm file if that would be helpful.

Thanks!

Gravatar is a globally recognized avatar based on your email address. re: wwSMTP problems sending htm files in message body
  Brett Carraway
  Steve Howie
  Jun 30, 2022 @ 10:16am

I think when I did this in Exchange there was a setting to use HTML email body by default. However, I was automating Outlook directly to generate my emails, not using SMTP at tlhe time. Could there be an Exchange server setting impacting the HTML body? hmmm.

FYI, I am looking for work. See my job post in this message board: https://support.west-wind.com/Thread6D40VDOKO.wwt

Gravatar is a globally recognized avatar based on your email address. re: wwSMTP problems sending htm files in message body
  Rick Strahl
  Steve Howie
  Jun 30, 2022 @ 10:55am

You should be able to use HTML for your messages. If you're reading the data from file, what are you actually getting? You should examine the file and make sure it's not in some funky encoding - if you're getting an error for invlaid characters it's likely low ascii characters (Chr(0)) which would indiciate that the file is perhaps encoded as Unicode and you need to decode it first.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwSMTP problems sending htm files in message body
  Steve Howie
  Rick Strahl
  Jul 1, 2022 @ 10:07am

Thanks for the info, Rick. Turns out that apparently we had a comma at the end of our bcc list, which was throwing off things.

The message returned from O365 was: "An invalid character was found in the mail header: '"'."

Once that comma was removed, everything started working, including all our old html code from the file <whew!>

We are fighting a few workstations not wanting to load wwDotNetBridge.dll. I'll start a new thread if we can't get past that, but so far this is a great solution for our system to replace our ancient CDO object - thanks!

Gravatar is a globally recognized avatar based on your email address. re: wwSMTP problems sending htm files in message body
  Rick Strahl
  Steve Howie
  Jul 1, 2022 @ 10:36am

You'll want to make sure you use a reasonably recent version of wwDotnetBridge which has logic in it to get around the DLL blocking issue you're likely seeing.

+++ Rick ---

© 1996-2024