Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FoxyPreviewer generated HTML good in browser but appears different in email body

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
545
MU
Hi friends,

I am using FoxyPreviewer to generate HTML from a FRX. The HTML looks very much good when viewed in a browser. But, when this file is used to embed the content as body of an email, it looks different. Checked with See2Fp and MailAlert utilities. Both give the same problem. Is this a known issue? Any comments?

Thanks
Rajesh
 
Hi Rajesh,

How are you embedding the HTML in the email? Are you doing it programmatically, by storing the HTML in the HTMLBody property? Or are you doing it manually in an email client? And, if the latter, are you simply pasting the HTML into the email, or what?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I don't remember ever trying to send the output from FoxyPreviewer programmatically in an email. But I have done it manually. In my email client (which happens to be Thunderbird), I open the email editing window and simply paste the HTML there. As far as I know, it has always worked correctly.

Does that help at all?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Dear Mike,

I am sending email programmatically. I tried with MailAlert utility. There is a parameter for body. Either you can have pure text or specify a file to take the body content from (this is in case of html)

When I manually created a html with same content and with basic html tags, sent through the same way, it works!

Rajesh
 
Rajesh,

You say that there is a parameter for Body. Is there also a parameter for HTMLBody? If so, that is the one to use. (I am not familiar with MailAlert but all other email systems I know have separate properties for Body and HTMLBody.)

It might be worth trying to send the HTML through another system such as Outlook Automation or CDO. This would tell you whether it is MailAlert of Foxy that is at fault.

And what exactly goes wrong when you use MailAlert? How does the final email differ from the report itself?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I know this won't help. Foxypreviewer has a mail feature.
It's designed to add the report as PDF attachment, though, not as the mail itself.

It covers the usual need to mail invoices or such PDFs, where the mail text itself isn't the report, but maybe just a short placeholder text where customer name is inserted, account/customer number or such.

I see there could be a way to combine this, when you already loop through invoice data and have fields like customer mail adress at hand, you also have the information for the blanks in the mail text itself.

I think the major difference of HTML mail vs HTML in a browser is mail clients are only set to the mail body, ie the <body>htmlmailcontent</body>, not the full HTML. That's why it's called HTMLBody and not HTML.

Chriss
 
Chriss,

Good information/suggestion.

Chriss said:
mail clients are only set to the mail body, ie the <body>htmlmailcontent</body>, not the full HTML
I didn't know this. However, even after trying it in many ways, still I failed to get the email body show correctly.
Even, FoxyPreviewer's emailing good only if feed a basic html file into email body parameter.

Rajesh
 
If you send it to yourself and look at the raw mail body? Does your HTML come through or is it mangled?
Many mail clients allow you to see the raw MIME mail text with all meta information.

For example if you send a mail to google it has the option "Show Original":
show_original_wcq5ij.png


Which allows you to see the whole MIME composition as it arrives and helps very much to see what's going wrong.

It'll have a Mime part that's the HTML message. Something like this
Code:
------=_NextPart_000_0001_....
Content-Type: text/html; charset="uft-8"
Content-Transfer-Encoding: quoted-printable

<html [highlight #FCE94F]xmlns:v=3D"urn:schemas-microsoft-com:vml"...[/highlight]

If you yourself generate html that starts with a simple <html>, you'd see that embedded.
I think there are ways to get more control over the HTML as just the body, for example all CSS styles are typically set in the <header> part of HTML and are not usually under your control, embedded javascript also isn't executed, if your formatting depends on that.

If you want more control you'd have to go into the details of composing a MIME message fully from scratch, with HTMLBody you at most could perhaps break out of the <body> and control the overall HTML, but that's still only one text/html part of the MIME message without the headers like "Content-Type" that specify the charset, which could be one mismatch that leads to incorrect rendering of the HTML.

As you say simple HTML tags are showing correctly, what's a problematic HTML part that doesn't show up as it should?

Chriss
 
Chriss,

Sorry for coming back here a bit late.

I tried going inside the email raw mail text. Basically as I understand, when FoxyPreviewer converts FRX into HMTL, there are considerable amount of CSS content for exactly presending the FRX output in the HTML. Maybe, these tags conflicts with something.

Anyway, work on this is kind of suspended now.

Thanks,
Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top