Can't make smtp work. Please help. lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- gjunk · 2023-09-15 13:35 https://wiki.freepascal.org/Synapse_-_Email_Examples I 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; ---------------------------------------------------------------------- bobby100 · 2023-09-15 13:54 Did you included ssl_openssl in uses clausure? Did you put the ssleay32.dll in the same directory as your executable? ---------------------------------------------------------------------- gjunk · 2023-09-15 14:08 ssl_openssl is in the uses clause. ssleay32.dll is in the exe directory. ---------------------------------------------------------------------- TRon · 2023-09-15 15:25 As a note: comcast seem to require that you to enable 3th party access  Did you configured that ? ---------------------------------------------------------------------- bobby100 · 2023-09-15 15:35 Could you download the SMTP Test Suite and test your connection with the SMTP Client? https://sourceforge.net/projects/smtp-test-suite/ Just use the same parameters as in your code, and see the response. If it works for you, take a look at the code of SMTP Test Suite - it is also based on Synapse ---------------------------------------------------------------------- rvk · 2023-09-15 17:03 I'm not sure from when that example is, but it doesn't work anymore. When you use port 587, you want TLS. If you use port 465 you want SSL. At least... that's how it is with smtp.gmail.com. So the line  if SMTPPort<> '25' then SMTP.FullSSL:=true; is not correct. You want: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if SMTPPort = '465' then SMTP.FullSSL := True; Or if you are sure you are going to use 587 then you can just comment out the FullSSL := true line. Above changes worked for me. I think port 587 needs to use the STARTTLS. And when using FullSSL the STARTTLS is ignored (see the login code) and SSL is done automatically on connect. (but for smtp.gmail.com that's apparently not allowed.) ---------------------------------------------------------------------- gjunk · 2023-09-18 08:46 Quote from: TRon on September 15, 2023, 05:25:26 pmAs a note: comcast seem to require that you to enable 3th party access  Did you configured that ? I have my comcast accounts set up for 3rd party access. ---------------------------------------------------------------------- gjunk · 2023-09-18 08:56 It seems that comcast is turning off my email access after x number of failed access attempts. I understand now why they are the most hated company in the world. It takes me hours to get my access restored. I will try the 465 and 537 changes when I get some service back. Can anyone recommend a free email service to use for testing. ---------------------------------------------------------------------- rvk · 2023-09-18 09:01 Quote from: gjunk on September 18, 2023, 10:56:09 amCan anyone recommend a free email service to use for testing. gmail? For gmail you do need to use an App password. Regular passwords are not allowed for smtp access. ---------------------------------------------------------------------- delphius · 2023-09-18 09:02 Quote from: gjunk on September 18, 2023, 10:56:09 amCan anyone recommend a free email service to use for testing. Gmail?!  You can look under the hood of smtp connecting to gmail with my proof of concept native pascal tls sendmail unit based on Cryptlib