Solved

How do I send html e-mail with idSMTP

Posted on 2004-04-08
4
1,422 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

23 Experts available now in Live!

Get 1:1 Help Now