iOS Question How to test SMTP Connection without sending email

mcqueccu

Well-Known Member
Licensed User
Longtime User
I have this application I am working on, in which users have to use their own SMTP server details to send emails.
The problem I am encountering is whiles some servers are working with TLS, some don't and rather work with SSL.

My question is,
1. Is there a way to test the connection first by without sending email.
(This can help test both TLS or SSL on the submitted server and port to know which one works)

2. Is there a global connection that supports both tls/ssl?
(Example: All the testing servers are able to work in thunderbird, and other email client applications work with any server. how did they do it?)
 
Solution
The terms in your question are wrong.
SSL and TLS mean the same thing (SSL is the older version).
You are talking about SMTP over SSL/TLS vs. SMTP over StartTLS. These are two different protocols.
A low level implementation of StartTLS is available here: https://www.b4x.com/android/forum/t...on-tls-socket-to-a-tls-socket.133555/#content
It is not compatible with B4i.

2. It is technically not possible.
1. In many cases you can know the protocol based on the port: 465 - SSL/TLS, 587 - StartTLS.
Maybe you can try to login without a username and password. The connection will fail before the authentication step is it is the wrong protocol.

Erel

B4X founder
Staff member
Licensed User
Longtime User
The terms in your question are wrong.
SSL and TLS mean the same thing (SSL is the older version).
You are talking about SMTP over SSL/TLS vs. SMTP over StartTLS. These are two different protocols.
A low level implementation of StartTLS is available here: https://www.b4x.com/android/forum/t...on-tls-socket-to-a-tls-socket.133555/#content
It is not compatible with B4i.

2. It is technically not possible.
1. In many cases you can know the protocol based on the port: 465 - SSL/TLS, 587 - StartTLS.
Maybe you can try to login without a username and password. The connection will fail before the authentication step is it is the wrong protocol.
 
Upvote 0
Solution
Top