?
Solved

How do I send html e-mail with idSMTP

Posted on 2004-04-08
4
Medium Priority
?
1,448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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