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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

e-mail html format

Status
Not open for further replies.

davidmelvin

Technical User
Nov 3, 2000
13
US
Hello,

I’ve successfully completed an e-mail application that sends and receives text format e-mails. I would like to be able to send html format e-mails. It’s not necessary for the application to allow the user to create html files, the application can read an existing html file and send the information in the file. For example

NMSMTP1->PostMessage->Body->LoadFromFile("C:\\temp\\test.htm");

Can someone point me in the right direction?
 
Howdy,

HTML is text. It only is interpereted by a browser window or in this case an email client. You should be able to send it just like any other text.

If you cannot load the text like you stated above, try loading the file into a TStringList object with the LoadFromFile method. Then you can retrieve the entire file of text with the Text property. Sending the text should be easy at that point.

You may have to do some figeting with the code and use a few more tricks, but I feel certain the task you are trying to do isnt that difficult.

Good luck,
onrdbandit

No! Try not. Do, or do not. There is no try. - Yoda
 
Thanks onrdbandit.

The only problem is when I test it the html code is displayed when I receive the e-mail.

I tryed sending the html file via NMSMTP1->PostMessage->Body->LoadFromFile("C:\\temp\\test.htm");

Then I received it in Outlook to assure that I'm using an e-mail program that can read html code and display it properly.

The file displayed the html code in text mode.

Is there a property setting that allows you to toggle between text and html?

Regards,
David
 
I found it!

I used TSubType to set the type of file to html.

Regards,
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top