Solved

How do I send html e-mail with idSMTP

Posted on 2004-04-08
4
1,429 Views
Last Modified: 2012-05-04
Can someone give me an example of how to send html messages with idSMTP ?

<Moved as requested by mlmcc PE for Pascal>
0
Comment
Question by:pucko
  • 3
4 Comments
 
LVL 1

Author Comment

by:pucko
ID: 10782719
Oops. this is ment to be in the Delphi area. I will try to move it there....
0
 
LVL 9

Accepted Solution

by:
mocarts earned 125 total points
ID: 10789357
procedure TForm1.Button1Click(Sender);
var
  IdMsg : TIdMessage;
begin
  IdMsg := TIdMessage.Create(self);
  try
    with TIdSMTP.Create(self) do
    try
      UserID := sUserID;
      Host := sHost;
      IdMsg.Body.Assign(Memo1.Lines);
      IdMsg.Recipients.EMailAddresses := sToAddress;
      IdMsg.Subject := sSubject;
      IdMsg.From.Address := sFromAddress;
      IdMsg.From.Name := sFromName;
      IdMsg.ReplyTo.Add.Text := sReplyTo;
      Connect;
      Send(IdMsg);
      Disconnect;
    finally
      Free;
    end;
  finally
    IdMsg.free;
  end;
end;

wbr, mo.
0
 
LVL 9

Expert Comment

by:mocarts
ID: 10789363
oops, you need a HTML mail :) just a moment :)
0
 
LVL 9

Expert Comment

by:mocarts
ID: 10789476
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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