Closed ercolesptr closed 1 year ago
Are you using smtp
or smtps
class? To which port are you connecting?
I am using port 25 as the server has no authentication and does not need password or login credentials. Also when I tried smtp instead of smtps it does not compile. Can you give me an example how to use smtp?
You have to use smtp::auth_method_t
with smtp
, something like:
smtp conn("smtp.alepho.com", 587);
conn.authenticate("user@mailio.dev", "", smtp::auth_method_t::LOGIN);
Does it solve your problem?
The port has to be 25 as this server uses the default smtp port of 25.
When I used smtp instead of smtps it gave me an error. Do I have to include other headers besides message and smtp headers?
It shouldn't. Take a look of the example smtp_utf8_qp_msg.cpp, it uses SMTP not SMTPS. Does this example compile in your setup?
When I use smtp instead of smtps it is giving me an error:
smtp was not declared in this scope
Can you please copy here the minimum reproducible example?
I found the cause of the error. I had to amend this as well:
using mailio::smtp; instead of using mailio::smtps;
It worked perfectly now, I used port 25 and "" for both login and password and email was sent and recived.
I have build the project with mingw and know that it is working because I was able to send email via a server needing starttls. Now however I need to send an email via an smtp server which does not require any login or security protocol. I tried to send the email using NONE instead of starttls and setting the login and password to "". However it is giving me an error cannot start tls. Why is the None flag not working?