掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
メール、SMSの送受信についてお教え願います。 (ID:149115)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
Takeさま、大変遅くなりましたが、取り合えず現在使用している受信部upしましたので、改善箇所が、有りましたら ご指摘願います。(Dekoさまのもの丸写しです) procedure TForm1.Button5Click(Sender: TObject); var i,MsgCnt:integer; Pop3:TidPOP3; SSL_RCV:TIDSSLIoHandlerSocketOpenSSL; MSG:TidMessage; begin Memo2.Lines.Clear; Pop3:=TidPOP3.create(nil); try { // OK です Pop3.Host:='pop.nifty.com'; Pop3.Port:=995;//10;//995; Pop3.username:='********@nifty.com'; Pop3.Password:='********'; } //ダメです Pop3.Host:='pop.Gmail.com'; Pop3.Port:=995;//110;//995; Pop3.username:='********@gmail.com'; Pop3.Password:='********'; //'**** **** **** ****';アプリパスワード //------------------------------------- SSL_RCV:=TIDSSLIoHandlerSocketOpenSSL.Create; try SSL_Rcv.Host:=POP3.Host; SSL_RCV.Port:=Pop3.Port; SSL_RCV.Destination:=SSL_RCV.Host+':'+Inttostr(SSL_RCV.Port); Pop3.IOHandler:=SSL_RCV; Pop3.UseTLS:=TiduseTLS.utuseImplicitTLS; // Error:username and Passwaord not Accepted //TiduseTLS.utUseExplicitTLS; //Error:Timeout POP3.Connect; // 問題点:ここでエラーがでる MSGCnt := POP3.CheckMessages; //サーバ上にあるメール件数を取得 //------------------------------ MSG:=TidMessage.create(nil); try msgcnt:=pop3.checkMessages; for i:=1 to MsgCnt do begin POP3.RetrieveHeader(i,msg); msg.NoDecode:=(LowerCase(msg.ContentTransferEncoding)<>'base64') and (LowerCase(msg.ContentTransferEncoding)<>'quoted-printabe'); pop3.Retrieve(i,msg); Memo2.Lines.add('Msg.Subject); Memo2.Lines.Add(msg.Body.Text); end; finally Msg.Free; end; POP3.Disconnect; finally SSL_RCV.Free; end; finally POP3.free; end; end; [1]username,Passwordは、メールで使用のものを、使用しています。 [2]アプリパスワード(Gmailで設定で取得の16桁コード)の検討しましたが、ダメでした。 [3]GogleAPi:習得検討中ですが、Delphiで組みたいです。 [4]Delphi10.3のProjectの配置で、exeフォルダーのSSLの*.Dllが記載は、確認しています お忙しいところ恐縮ですが、宜しくご指摘ください。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.