Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : sent emails with Gmail

www.cryer.info
Managed Newsgroup Archive

sent emails with Gmail

Subject:sent emails with Gmail
Posted by:"FALKOR" (arturoportil..@gmail.com)
Date:Fri, 17 Mar 2006 08:40:24

hi!;

i need to sent emails using a Gmail account, my app is written on Delphi 7
with the bundle indy components... i have the next code, but it seems it
cant connect, Any ideas?

     eMessage.Body.Assign(Etexto.Lines);
     eMessage.From.Text := Gcorreoori;
     eMessage.Recipients.Clear;

     If Ansipos(';',x) > 0 Then
     begin
          x:= epara.text;
          While Ansipos(';',x) > 0 Do
          Begin
               eMessage.Recipients.Add.Address:=Copy(x,1,Ansipos(';',x)-1);
               x:=Copy(x,Ansipos(';',x)+1,999);
          End;          { while }
     end
     else
         eMessage.Recipients.Add.Address:=Epara.Text;

     eMessage.Subject := easunto.Text;
     TidAttachment.Create(eMessage.MessageParts,Efile.FileName);

     Emessage.Priority := TidmessagePriority(mpHighest);
     SMTP.AuthenticationType := atLogin;
     SMTP.Username           := Gcuenta;
     SMTP.Password           := Gpassword;
     SMTP.Host               := Gserver;
     SMTP.Port               := Strtoint(Gpuerto);
     SMTP.U

     SMTP.Connect(1000);
     Try
     begin
          SMTP.Send(Emessage);
          MessageDlg('El archivo fue enviado
correctamente',mtInformation,[mbOk],0);
          DeleteFile(Efile.FileName);
     end
     finally
          SMTP.Disconnect;
     END;

Replies:

www.cryer.info
Managed Newsgroup Archive