|
| Send E-Mails with Indy Components (Easy) |  
|
|---|
| very, very easy | Product: Delphi 5.x (or higher) | Category: Internet / Web | Skill Level:
 | Scoring:  | Last Update: 08/27/2002 | Search Keys: delphi delphi3000 article borland vcl code-snippet Indy Emails send internet facunte | Times Scored: 7 | Visits: 9914 | Uploader: emerson facunte Company: Consultant | Reference: Facunte | | Component Download: ../ | | | Question/Problem/Abstract:
What send e-mails with INDY? | Answer:
Hi friends,
I´m Emerson Facunte, from Brazil (great Country, intelligent and beautyful people, our country is hot).
ok.ok.
I´m going to start a step-by-step description of building a simple program for sending e-mails with Indy Components.
This article is the published in my 6th book of Delphi (see more details in www.facunte.com.br, sorry Portuguese Language only).
Let´s go friends.
Start a new project and insert TidSMTP, TIdAntiFreeze and TidMessage, from the Indy Components.
The routine is implemented
procedure TfmeMail.btSendClick(Sender: TObject);
begin
// Config Client
idSMTP1.UserId:=edUser.Text; // TEdit
idSMTP1.Password:=edPass.Text; // TEdit
idSMTP1.Host:=edHost.Text; // TEdit
idSMTP1.Port:=StrtoInt(edPort.Text); // edPort = TEdit
// Atribui o Conteudo do objeto TextodoEmail
// ao objeto PPMensagem
// Connect SMTP Server
idSMTP1.Connect;
try
with MyMessage do // Message = TidMessage
begin
// Config Subject
Subject:=edSubject.Text; // edSubject = TEdit
// Config
From.Text:=edUser_ID.Text; // edUser_ID = TEdit
// Config Recipient
Recipients.EMailAddresses:='put addresses mail for the recipient';
ReceiptRecipient.Address:='put a list of recipient addresses';
// examples
// Recipients.EMailAddresses:='davidi@borland.com';
// ReceiptRecipient.Address:='man1@borland.com;man2@borland.com;emerson@facunte.com.br';
// Config Message
Body.Text:=edMessage.Text; // TMemo
// Send e-mail
idSMTP1.Send(MyMessage);
end; // with MyMessage
finally
// Discconect Server
idSMTP1.Disconnect;
end;
end;
It´s all friends.
Sorry, i´m promisse evolution my english !!!
|
|