Rank: Newbie
Groups: Registered
Joined: 12/28/2020(UTC)
Posts: 0
Location: Davao City
Failed to send email with the following error. Error with connecting server; socket error:0x00002746 oSMTP.ServerAddr := 'smtp.gmail.com'; oSMTP.ServerPort := 465; oSMTP.FromAddr:=email; oSMTP.Subject :='Payslip for the period:'; osmtp.Username:=email; oSMTP.Password := smtppassword; oSMTP.ConnectType:=4; oSMTP.BodyText:='Please see attached file for payslip details..'; fname :='.\Payslips\payslip.pdf'; if FileExists(fname) then oSMTP.AddAttachment(fname); //send mail if oSMTP.SendMail()= 0 then begin result := True; end else begin ShowMessage('failed to send email with the following error: ' + oSmtp.GetLastErrDescription()); result := False; end;
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
If you use 465 port, please use ConnectType := 1
ConnectType := 4 is for 25/587 port.
Code:
ConnectNormal = 0;
ConnectSSLAuto = 1;
ConnectSTARTTLS = 2;
ConnectDirectSSL = 3;
ConnectTryTLS = 4;
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.