Comments (6)
As described, the port 465 is for TLS and 587 for STARTTLS. Thus, use either
smtps conn("smtp.gmail.com", 465);
conn.authenticate("MY_EMAIL", "MY_PASSWORD", smtps::auth_method_t::LOGIN);
or
smtps conn("smtp.gmail.com", 587);
conn.authenticate("MY_EMAIL", "MY_PASSWORD", smtps::auth_method_t::START_TLS);
Let me know if this helps.
Cheers
from mailio.
Thanks for the response, I can now connect to the smtp server, but when I try to send a message, using conn.submit(msg);
, I get the error:
terminate called after throwing an instance of 'mailio::smtp_error'
what(): Mail sender rejection.
Do I have to set something up to allow my email address to send via smtp?
from mailio.
- Is the authentication email same as the sender email?
- Do you have enabled 2FA for that email account?
from mailio.
- Yes sender and auth email are the same
- No 2FA on the account
from mailio.
Can you please add printing of the received line in the problematic case? So, something like
if (std::get<1>(tokens) && !positive_completion(std::get<0>(tokens)))
{
std::cout << std::get<2>(tokens) << std::endl;
throw smtp_error("Mail sender rejection.");
}
in this part (file and lines smtp.cpp:88-89
), then recompile mailio, start the example again and paste here the result (remove the sensitive info if any). (Obviously I have to add better error reporting in this case.)
from mailio.
I wasn't able to add this line and recompile as I built using vcpkg and it was over complicated trying to rebuild.
But I did setup nodemailer in node.js and was able to figure out how to setup my gmail account to allow it to send via smtp.
Essentially, gmail disabled low security sign in and now you have to enable 2FA and create an app password:
https://stackoverflow.com/a/45479968/15003926
After doing this I am no longer getting the Mail sender rejection error.
from mailio.
Related Issues (20)
- Unexpected spaces in mail content HOT 12
- Missing file export.hpp HOT 3
- How to generate now a shared library HOT 1
- Why can the error "Mail sender rejection." be thrown ? That the SMTP server responds that such an error occurs?
- Horizontal tabs in header bodies HOT 3
- Proper way to compile a project HOT 4
- Cannot Build Project in Qt Creator on Windows 10 HOT 6
- imap::append failing HOT 3
- Reserved identifiers HOT 2
- Unknown Signal Exception After Sending Email HOT 4
- Issue Building HOT 2
- smtps_attachment.cpp wont work HOT 13
- None flag not working HOT 9
- Compiler flags are missing HOT 1
- [Question] Is there any way to get list of only unread messages via IMAP? HOT 6
- Documentation of auth_method_t HOT 2
- Catching 'dialog_error' HOT 2
- [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TLS) connections. HOT 1
- Problem while fetching mail via IMAP HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailio.