|
Enviar Gmail desde W2008 con Indy
Código Delphi [-]with smtpSendmail do begin
IoHandler:=IdSSLIOHandlerSocketOpenSSL1;
AuthType := satDefault;
Host := 'smtp.gmail.com';
port := 465 ;
useTLS:=utUseExplicitTLS;
Username :='[email protected]';
Password :='passwordxxxx';
end;
mail := TIdMessage.Create(Self);
with mail do begin
From.Address := '[email protected]';
Recipients.EMailAddresses := '[email protected]';
Subject := 'asunto';
body.Text := 'Texto del mensaje';
end;
try
begin
memoMsg.Lines.add('conectando con el servidor');
smtpSendmail.Connect;
memoMsg.Lines.add('conectado');
try
begin
memoMsg.Lines.add('enviando mensaje');
smtpSendmail.Send(mail);
end;
Última edición por Casimiro Noteví fecha: 06-12-2012 a las 20:16:00.
|