Delphi Indy 10 Smtp errore “Impossibile eseguire l'autenticazione al momento”

StackOverflow https://stackoverflow.com/questions/9310890

  •  26-10-2019
  •  | 
  •  

Domanda

Sto usando questo pezzo di codice per posta un messaggio di prova da Indy Delphi. Ho un TidSMTP, TIdMessage e IdSSLIOHandlerSocketOpenSSL;

Nel codice belowe se ho impostato fino a utilizzare Gmail con SSL funziona benissimo, ma appena ho sostituire il mio i dettagli del server con i miei cPanel detials del server di posta non è così l'errore di lavoro:

"in grado di autenticare allo stato attuale".

Ho usato stessi dettagli che userei per impostare il mio conto in Outlook 2007. Ecco il codice

dettagli IdSSLIOHandlerSocketOpenSSL.

method := sslvsslv3
mode := sslmUnassigned

//rest default values

procedure Tfrmnotification.btnSendClick(Sender: TObject);
var
  IdMsg : TIdMessage;
begin

begin
  IdMsg := TIdMessage.Create(nil);
  try
    with TIdSMTP.Create(nil) do
    try
     // UserName := 'something@gmail.com';
     // Password := 'pass';
     // Host := 'smtp.gmail.com';
     // IOHandler := IdSSLIOHandlerSocketOpenSSL;
     // Port := 587;
      UserName := 'something@sasra.co.za';
      Password := 'password';
      Host := 'outgoing server detials';// same as outlooks
      IOHandler := IdSSLIOHandlerSocketOpenSSL;
      Port := 465;// this is correct port
      UseTLS:=  utUseExplicitTLS;


      IdMsg.Body.Add('test');
      IdMsg.Recipients.emailAddresses := 'something@gmail.com';
      IdMsg.Subject := 'test';
      IdMsg.From.Address := 'something@sasra.co.za';
      IdMsg.From.Name := 'john';


      Connect;
      Send(IdMsg);
      Disconnect;
    finally
      Free;
    end;
  finally
    IdMsg.free;
  end;
  showmessage('done');
end;

Qualsiasi aiuto sarebbe appricated.

È stato utile?

Soluzione

Port 465 viene utilizzato per SMTP su SSL implicito. Hai UseTLS set a utUseExplicitTLS. Il valore corretto dovrebbe (più probabile) essere utUseImplicitTLS.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top