Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Registered Trademark and Bold text from Unix mail?

SOLVED
Go to solution
John J Read
Frequent Advisor

Registered Trademark and Bold text from Unix mail?

I'm pretty sure I can't do this but wanted final confirmation.

I am sending a text file out as the body of an email using sendmail. I have been asked to include a "registered trademark" in the text as well as BOLD some other text.

It is my understanding that in order to do this, I would have to generate the email body in HTML format and then the email client, say Lotus Notes, or Microsoft Outlook would then present the email body with the special characters and formatting.

However, I do not want to get into HTML coding of this email. I could do it but what would I do if the end user does not accept or want HTML encoded email?

Is there an ascii character for "registered trademark" and is there any other way to format the text for a body of an HP-UX generated email other than html?

Any advice would be greatly appreciated and points will be rewarded.
6 REPLIES
Steven E. Protter
Exalted Contributor
Solution

Re: Registered Trademark and Bold text from Unix mail?

I've studied this problem myself.

The only way to get bold characters into the email is the html method. That doesn't mean it is the only way. That means I studied it for several hours, ran some searches and eventually solved the probme that way.

In order to send it out text based, I used Microsoft word, save as web page and then edited the file so it would work correctly.

I used the script I'm attaching to do the job. This script does attachments and can have a line added to read the file into the body.

The html isn't so bad.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
John J Read
Frequent Advisor

Re: Registered Trademark and Bold text from Unix mail?

Great! Nice script! This helped a lot with creating html attachments. I did not know about uuencode and that did the trick for creating the html attachments.

However, I'm still having trouble when I simply want the html to show up as "web" content in the email body when viewed with an html enabled email client (Lotus Notes in my case.) What I've tried so far:

1) First uuencode the HTML file then use output of `cat filename` ( of uuencoded output )as the body using sendmail and it shows up as an html attachment.

2) Use output of `cat filename` on the HTML file as body using sendmail and it shows up as simple text.


I'm guessing there must be a tag that I need to add to the html but it seems that html formatted emails I've received don't have any special tags.

Still looking. I'll post again when this last puzzle is figured out.
Chris Watkins_1
Respected Contributor

Re: Registered Trademark and Bold text from Unix mail?

I've had to script out a few things to send this way.

Make sure you start out with the required headers... like:

Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit



You can add "Reply-To:" or other headers as needed, obviously.
These two will get you started, and identify the mail as html format.


Not without 2 backups and an Ignite image!
Elmar P. Kolkman
Honored Contributor

Re: Registered Trademark and Bold text from Unix mail?

To solve your issue with people not accepting HTML mail: you need to send it twice in one mail, once HTML and once plain text.

As for the formatting: isn't there someone out there who has created a HTML macro file for nroff/troff/groff? With that it would be easy to create both files by running it with two -T options (html and ascii). With the correct text inbetween those texts that would solve your issue of formatting the text.

I don't have a environment right now to test it, otherwise I would have looked into it further. Also, you could take a look at the mail modules for perl. I think they can help you solve this too.
Every problem has at least one solution. Only some solutions are harder to find.
John J Read
Frequent Advisor

Re: Registered Trademark and Bold text from Unix mail?

Awesome help from everyone. Putting in the required headers to the sendmail command did the trick.


BODY=`cat body.htm`

/usr/sbin/sendmail -fJohn_Read@something.com john_read@something.com <Content-Type: text/html; charset=us-ascii]
Content-Transfer-Encoding: 7bit
Subject: "test"
${BODY}
EOF


Last question: Elmar mentions sending the body twice in one mail (html and text.) I'm not sure what you mean by that. Are you saying there's a way for the email client to read the text version if the html can't be processed?
Elmar P. Kolkman
Honored Contributor

Re: Registered Trademark and Bold text from Unix mail?

Yep, it is the default to do this for mailers like Netscape/Mozilla etc. to do this. You need to make the mail multi-part and send both text and html version of the mail.
Every problem has at least one solution. Only some solutions are harder to find.