Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
jrgeralde  
#1 Posted : Monday, December 28, 2020 10:11:29 PM(UTC)
jrgeralde

Rank: Newbie

Groups: Registered
Joined: 12/28/2020(UTC)
Posts: 0
Philippines
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;


ivan  
#2 Posted : Tuesday, December 29, 2020 1:15:38 AM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,148

Thanks: 9 times
Was thanked: 54 time(s) in 54 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;

Users browsing this topic
Forum Jump  
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.