Solved

How to send a HTML FORMAT mail with Winsock?

Posted on 2002-05-17
5
172 Views
Last Modified: 2010-05-18
  I have known how to send a TEXT/FORMAT's mail!But,I don't know how to send a HTML/FORMAT's mail!can you help me?!!!
   Thanks a lot!
0
Comment
Question by:yanxiaobai
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 7017803
add this as part of the header of your message:

Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
0
 
LVL 1

Accepted Solution

by:
VENKAT earned 50 total points
ID: 7028888
Hi
    you can use this Delphi component "TGLHTMLTable" to convert ur data to HTML format. so u can send mails using below single line of code. Down below is to convert to HTML page..

     SMTPForm:=TSMTPForm.Create(self);

procedure TStandardForm.HTMLwwDBNavigatorButtonClick(Sender: TObject);
var
     sHtmFile:string;
begin
     //sHtmFile:= ExtractFileNameOnly(StdTable.TableName)+'.htm';
     sHtmFile:= ExtractFileName(StdTable.TableName);
     sHtmFile:= Copy(sHtmFile, 1, Pos('.', sHtmFile)-1)+'.htm';

     GLHTMLTable1.caption     :=Caption;
     GLHTMLTable1.filename:=Mainform.sDir+'\'+sHTMFile;
     StdTable.First;
     GLHTMLTable1.SelectFields;
     GLHTMLTable1.Execute;

     if FileExists(GLHTMLTable1.filename) then begin
          ShowMessage(GLHTMLTable1.filename+' created !');

          if GetComCtlVersion()=ComCtlVersionIE3 then begin
               Mainform.bIE4:=False;
               KWB4IE3Form:=TKWB4IE3Form.create(self);
               Kwb4IE3Form.URLComboBox.text:=GLHTMLTable1.Filename;
               Kwb4IE3Form.GoBtnClick(nil);
               KWB4IE3Form.Show;
          end
          else begin
               Mainform.bIE4:=True;
               KWBMainForm:=TKWBMainForm.create(self);
               KwbMainForm.URLComboBox.text:=GLHTMLTable1.filename ;
               KwbMainForm.GoBtnClick(nil);
               KWBMainForm.Show;
          end;

          Cascade;
     end;
end;
0
 

Expert Comment

by:SpideyMod
ID: 8280699
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 8281530
been busy doing a lot of cleanups eh, spideymod? :) ... good job
0
 

Expert Comment

by:SpideyMod
ID: 8284036
DragonSlayer,
Yep.  I've taken on the task of cleaning up all 6000+ locked questions across the site.  It daunting, but will be done in a week or so.  Thanks for the kudos.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now