https://wiki.freepascal.org/Synapse_-_Email_ExamplesI used Example 4.
I have entered and compiled the error checking version of this code using synapse4.
It compiles and runs.
I get the following error in the memo box when I click on button1.
Other undefined Status
SMTP Login: Failed - does server exist? does it accept mail?
I have tried it with smtp servers from Comcast, Gmail and ABQoff.
The emails work both sending and receiving in Thunderbird so the addresses and passwords are correct.
I have tried both port 465 and port 587.
Am I missing something?
procedure SendMail(User, Password, MailFrom, MailTo, SMTPHost, SMTPPort: string; MailData: string);
procedure TForm1.Button1Click(Sender: TObject);
begin
SendMail(
'gjunk@comcast.net', // Name if authentication required
'Password', // Password if authentication required
'gjunk@comcast.net', // MailFrom
'1test@abqoff.com', // MailTo
'smtp.comcast.net', // Mail server to send to
'465', // Mail server port
'To: 1test@abqoff.com' // Otherwise To: is blank on receipt
+ LineEnding + 'Subject: Test' // Otherwise Subject: is blank on receipt
+ LineEnding +'Gday!' // Email body
+ LineEnding);
end;