How to send email using Qt 5.5.1
-
Hello everybody!
I appeal in your knowledge because I look and try but unsuccessfully.
For some time I try to send e-mails by using my application.
I tried classes shared on the net but none works.
Have you classes whom I can use without too many complications?
Thanks to you!Best Regards,
John -
Depends on what service your mail is based on.
-
Microsoft Exchange -> The API is proprietary so the only method I know of is using C++/CLI (so the whole .Net framework stuff)
-
SMTP -> libcurl is probably the most popular library
You can still handle it all manually via QTcpSocket however.
Honourable mention, even if it's not so popular: https://www.vmime.org/
-
-
To build libcurl you can use CMake
Example of email with libcurl: https://curl.haxx.se/libcurl/c/smtp-ssl.html
How to integrate libcurl in Qt Creator: http://doc.qt.io/qt-5/third-party-libraries.html -
-
@raven-worx said in How to send email using Qt 5.5.1:
easiest would be to use a already existing solution.
like this one - drawback is that it was written for Qt4. So it may not compile for Qt5 without some modifications.... i don't know.
Or this one for Qt5.Worth to check at least.
Thanks for your feedback.
I have tested for Qt5.
After compilation I have this error.
http://prntscr.com/ca9fjp
I need install OpenSSL ? -
-
@raven-worx said in How to send email using Qt 5.5.1:
@John_38 said in How to send email using Qt 5.5.1:
I need install OpenSSL ?
yes
I have installed 'OpenSSL'.
I have paste 'libeay32.dll' and 'ssleay32.dll' in my .exe directory.
I have this error: http://prntscr.com/canynu
Can you help me ? -
@John_38
are you creating the socket and it connection?
or is this handled internally in the lib? -
@raven-worx said in How to send email using Qt 5.5.1:
@John_38
are you creating the socket and it connection?
or is this handled internally in the lib?No I dont know how to :/
Can you tell me what I need to do ?
Thank man ! -
Ok now I have modified settings on my google account.
It's work now.
But after mail send my application crash..
I don't know why..
Can you help me ?
http://prntscr.com/caqya2 -
Hi,
The best way to know why is to run your application through the debugger, you should get the point where the problem occurs.
-
@SGaist said in How to send email using Qt 5.5.1:
Hi,
The best way to know why is to run your application through the debugger, you should get the point where the problem occurs.
Hi, thank for your feedback.
I have using the debug mode.
This is error: http://prntscr.com/cb2q7n -
The link shows a broken image
-
My error: http://imgur.com/0FeDXPJ
-
Are you doing any multi-threading stuff with that class ?
-
You should check what data you receive.