Discussion Locked

Command line email in HTML format

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I can email an HTML page from any Win/Email client interactively. But I want to do it dynamically from a script (either Unix/sendmail or NT vbs/WSH scripting). When I do, the message is always the text version of html source (as plain text with visiable tags in it), instead of presenting as a webpage. How can I do that?

4 replies

by astute

An email header specifies content type, transfer encoding, and display properties of the mail. The most important of these header fields for HTML email is Content-Type. Most mail agents send mail with Content-Type: text/plain, but you want yours to read Content-Type: text/html.

For example...

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

Hello there.
This is a test.
.

Thats it...
Good luck

by dognoyler

Thanks but that doesn't work.
I had already tried content-type...etc.
It simply comes in as "ascii text" in the message.... (Just like your message above ... verbatim!)

by astute

Hi this worked for me ...

telnet mailserver 25

Helo test

Mail from: sharan@iname.com

rcpt to: sharan@somedomain.com

data
Content-type: text/html

this is a test

.
quit

And I got the mail in Html format ( in both
outlook 2000 & Lotus Notes 5.05)

Again there are many ways of doing it...

1. Use CDONTS with IIS .
( only issue is u have to install smtp on the web server )

example at http://204.57.245.160/cdo/cdonts.htm

OR

The best solution is use a com component like aspemail (http://www.aspemail.com/)
which can send mails in html format, I have used this component in couple of projects & found it good.
Let me know in case u need some more help

Good luck

by shanghai sam

CDONTS is a powerful libary, designed for server-use. CDONTS is independent the settings of the computers email program.
If you use the newmail-object you can make a mailing procedure with only three lines of code. But SMTP have it's limitations, instead you can use CDO, wich is using the computers mail agent (just as a mailto: statement in HTML). Try the HTMLBody property in the message-object. A even more poowerful soulution is a combination of CDO and CDOHTML.
A good source of information is (http://www.cdolive.com/start.htm) there you can download the most current helpfiel at (http://www.cdolive.com/download/cdo.zip).
Good luck!

This discussion is closed to new replies.