Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (10)


Send E-Mails with Indy Components (Easy)Go to emerson facunte's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
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:
9
Visits:
12361
Uploader: emerson facunte
Company: Consultant
Reference: Facunte
 
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 !!!





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Send e-mail to hotmail.
    John Ducati (Aug 14 2007 10:33AM)

Thx for the above,
but how to send e-mail
to hotmail using Delphi, any help with it?
Respond

Servidor de email
    Beatriz Corrales (Oct 26 2004 2:37PM)

olá, eu também sou brasileira e gostaria muito de saber como se faz um servidor de email usando os componentes Indy. Por favor, me ajudem!

obrigada desde já!
Respond

How to keep images lay-out between text without using references to other ISP
    FABIO RAVAZZOLO (Mar 26 2004 3:08PM)

Hi people !

Does anybody know how to attach correctly images inside e-mail, to keep its lay-out without making references to its position in other site, i.e., follow an example:
html
...
body
You can read a big history img src="http://.../images/BigHistory.jpg"

/body
/html

How can we implement img src="http://.../images/BigHistory.jpg" in another form ? Using Indy components ! I don't want use references in other point of Internet, I want use the image that goes with the e-mail sent...keeping the lay-out like seeing a html form in the web.

I've read source code from Indredimail, and this software has implemented this idea.

Have you understand ?


Respond

How to keep images lay-out between text without using references to other ISP
    FABIO RAVAZZOLO (Mar 26 2004 3:06PM)

Hi people !

Does anybody know how to attach correctly images inside e-mail, to keep its lay-out without making references to its position in other site, i.e., follow an example:

...

You can read a big history




How can we implement in another form ? Using Indy components ! I don't want use references in other point of Internet, I want use the image that goes with the e-mail sent...keeping the lay-out like seeing a html form in the web.

I've read source code from Indredimail, and this software has implemented this idea.

Have you understand ?


Respond

Does anybody know how to send an e-mail to a free email server like hotmail.com ?
    FABIO RAVAZZOLO (Mar 17 2004 11:18PM)

How can I send an e-mail to hotmail.com ou ig.com.br ?

I tried attribute to host property of Indy SMTP component some one like this smtp.ig.com.br ...
Respond

RE: Does anybody know how to send an e-mail to a free email server like hotmail.com ?
Fábio Mário Pétta Ravazzolo (Mar 19 2004 12:17PM)

Hi people, I've called to a big ISP here in Brazil, and to send e-mails to IG ( Internet Gratis - Free Internet), I have to use de dialer from this ISP, because the ISP just recognize its IP address. Otherwise, ISP e-mail server is going to reject all e-mails sent from me.

I'll beg your pardon about my poor english...bye and thanks !
Respond

and attachment
    DAID cito (Aug 31 2003 9:43PM)

procedure TForm1.Button1Click(Sender: TObject);
begin
idsmtp1.Host:=server.text;
idsmtp1.Port:=25;

tidattachment.Create(idmessage1.MessageParts,opendialog1.filename);//Add's attach!.
idsmtp1.connect;
try
with idmessage1 do
begin
subject:=subjectto.text;
from.Text:=frommail.text;
from.Name:=namesender.text;
body.Text:=bodymemo.text;
recipients.EMailAddresses:=mailto.text;
receiptrecipient.Address:=copymail.text;
idsmtp1.Send(idmessage1);
end;
finally
idsmtp1.Disconnect;
end;



end;//recuerda que el adjunto tiene que ser pequeño, dependiendo de la capacidad del servidor de correos del recipiente.
Respond

RE: and attachment
namelysweet (Sep 9 2003 6:40PM)

it's seems not to work with your code...it's display connection graceful...???!!!
Respond

RE: and attachment
namely sweet (Sep 9 2003 6:55PM)

how to resovle the dns mail server?
Respond

RE: RE: and attachment
chester (Mar 18 2004 7:23PM)

¿Cómo puedo programar un servidor SMTP, alguna ayuda porfavor
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Maes
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)