Delphi GEmail
1.0.0
Delphi 類別使用 gmail 傳送電子郵件。
使用樣本:
Gmail := TcfsGmail.Create( ' [email protected] ' , ' App password ' , ' From you/company ' );
try
try
Gmail.Connect;
Gmail.Send([ ' [email protected] ' ], ' Subject ' , ' PlainBody ' , ' htmlBody ' , ' AttachmentFile ' );
// Gmail.Send(...);
// Gmail.Send(...);
except
on E: Exception do
ShowMessage(E.Message);
end ;
finally
GEmail.Free;
end ;
注意 1:在可執行檔路徑中新增兩個 openSSL 函式庫:「libeay32.dll」和「ssleay32.dll」。
註2:設定您的電子郵件「[email protected]」帳戶以允許從外部應用程式發送郵件:輸入您的個人設定(gmail)進入「安全性」:啟動「兩步驟驗證」並新增「應用程式密碼”或啟動“允許安全性較低的應用程式”
更多資訊:http://delphiprogrammingdiary.blogspot.com/2016/09/send-email-with-html-body-format-in.html http://www.andrecelestino.com/delphi-xe-envio-de -電子郵件-com-componentes-indy/