Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 2 odgovora
  • 2.711 pregleda

Najnovija ↓

Re: slanje Gmail-a preko Delphi7 27.10.2014. u 10:18 · pre 146 meseci #2
Evo Indy primer (ne testirano), ne zaboravi da moraš imati openSSL dllove (libeay32.dll, ssleay32.dll, zlib1.dll).

Code:


uses
  IdSmtp, IdMessage, IdPop3, IdAttachmentFile, IdSSLOpenSSL, IdExplicitTLSClientServerBase;


var
  Smtp: TIdSmtp;
  Msg: TIdMessage;
begin
  Smtp := TIdSMTP.Create(nil);
  try
    Msg := TIdMessage.Create(Smtp);
    with Msg do
    begin
      Subject := 'Proba';
      From.Text := '[email protected]';
      Recipients.EMailAddresses := ''[email protected]';
      Date := Now;
    end;

    with Smtp do
    begin
      try
        MailAgent := 'Test prg';
        Host := 'smtp.gmail.com';

        Smtp.Port := 465;
        Smtp.Username := 'UserName';
        Smtp.Password := 'Pass';
        Smtp.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(SMTP);
        Smtp.UseTLS := utUseExplicitTLS;

        Smtp.Connect;

        Send(Msg);
        Disconnect;
      except
        on E: Exception do
        begin
           raise;
        end;
      end;
    end;
  finally
    Smtp.Free;
  end;

Potpis
Do not be a help vampire (http://slash7.com/pages/vampires), use the google.

How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html
http://solair.eunet.rs/~fangor...stions/smart-questions.sr.html
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme