I’m using LIBCURL for sending mail . Things that works is when SMTP port is 587 . Yesterday i needed to implement sending mail on server with port 465 . As result , I took a error that timeout
exceeded . I supposed that problem is username , password , but on webmail client I found that everything passed , and really SMTP port is 465. Any help with errorcodes, when I played with port, changed it to 587 response was OK, Of course user didn’t got mail. Why curl.send response to me that action is OK. Is there a way to validate mail (on existing) .before sending, mail was sent, but not received. Above all , what is strange with 465 port?
Thanks
Can you reproduce the issue with curl.exe?
Also which version of libcurl are you using? I highly recommend to download the latest, there was a fix recently that may be related to your issue (“Explicit scheme was overwritten with the default protocol.”)
C:\Users\user>curl --url “smtp://mail.srebrenik.ba:465” --ssl-reqd --mail-from “[email protected]” --mail-rcpt “[email protected]” --user “[email protected]:platneliste123” -T “C:\scan\email.txt”
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- 0:02:00 --:–:-- 0
curl: (28) server response timeout
It seems that problem is on the other side , not on “our” .
Libcurl is from 11.08.2024 .
But problem is still here. What can be on the other side (mailserver) , to not receive commands other than “certified clients” . cPanel, L.L.C. Webmail , Outlook works fine ?
Look into the detailed curl/libcurl log.
I tried to send mail from smtp.gmail.com:465 using libcurl-master\examples\C6.3 apps\SendMail.exe
No success . Program regulary send mails from smtp.gmail.com:587 .
Missing something ?
Try smtps:// protocol if smtp:// doesn’t work.
Currently main commands in SendMaill app are:
curl.Init()
curl.Server(CLIP(ServerName), CLIP(PortNumber))
curl.Account(CLIP(UserName), CLIP(Password))
curl.From(CLIP(EMailFromName)&‘<’&CLIP(EMailFromEMailAddress)&‘>’)
curl.AddRecipient(CLIP(MailToName)&'<'&CLIP(MailToEMailAddress)&'>','','')
! curl.UseSSL(CURLUSESSL_TRY) !try using ssl first. If it fails try without SSL
! curl.SetSSLVerifyPeer(FALSE) !curl --insecure
curl.UseSSL(CURLUSESSL_ALL)
curl.SetSSLVersion(CURL_SSLVERSION_TLSv1)
curl.SetSSLVerifyPeer(FALSE) !curl --insecure; don’t use it in real apps
curl.SetOpt(CURLOPT_CONNECTTIMEOUT, 30)
Res = curl.Send()
What is equivalent form smtps:// ?
Thanks
Add it to the server name: smtps://smtp.gmail.com
I am using this class and it is working fine.
curl TCurlMailClass