Sending email from gmail

Giganews Newsgroups
Subject: Sending email from gmail
Posted by:  Alexandre (alexandrepires20…@yahoo.com.br)
Date: Tue, 21 Aug 2007

How to send email with TIdSMTP from gmail account ?

I made this:

smtp:=TIdSMTP.Create(nil);
seguro:=TIdSSLIOHandlerSocketOpenSSL.Create(nil);

seguro.Host:='smtp.gmail.com';
seguro.Port:=465;

smtp.IOHandler:=seguro;
smtp.UseTLS:=utUseExplicitTLS;
SMTP.Port := 465;
SMTP.Username := my_username
SMTP.Password := my_password
SMTP.Host :='smtp.gmail.com';
SMTP.Connect;
SMTP.Send(IdMessage);
SMTP.Disconnect;
    ...
    ...
    ...

But dont work.

Replies