7 replies
by steved
Simply include the following email header:
Content-Type: text/html; charset=iso-8859-1
by shanghai sam
by steved
Have you looked at all the email headers that are actually being created? Is there another Content-Type header there that might conflict with the text/html one? For instance text/plain? In what order do the headers appear? Is there a Mime-Version header? If not, you may have to include something like "Mime-Version: 1.0".
The headers are the one and only factor that governs how the email client will interpret the message body. The problem has to be there. Look at the actual headers in your generated messages and compare them to those in an HTML format message that is being interpreted correctly. Then adjust yours to match.
Good luck!
Steve Diamond
by chipw
That helps alot. Now, forgive me if this is considered too basic, but how do I add the two needed headers - MIME-version and Content-type? Are they added to the cgi script? I am just learning this perl/cgi programing, and have 3 books and they seem to ignore the email options, must be covered in the advanced books.
PS,
what's up with the rating answers thing? I was going to hit the acceptable option then got a warning that I would have to close this question, which I wasn't ready to do yet.
by steved
Yes, you add the headers in your cgi script. I'll be a little hazy on the details because it's years since I've used Perl like this, but here's the basic idea. You're already adding email headers to your message when your script outputs lines like "Subject: my subject" followed by a newline character. You just need to add an additional line or lines of script to generate the other headers in a similar way. Either right before or right after the Subject line ought to work fine.
Regarding yourPS, I don't really know. I haven't asked any questions here, just posted answers. My impression is that the system is quite inflexible. I know of instances where questioners intended to award points but ended up closing the question and rejecting all the answers. I hope you won't let that happen to this one! :-)
SMD
by chipw
by chipw
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending