Simple TLS/SSL supported SMTP client for Qt5
-
Hi all,
I am working on application using Qt4.84 and the target system is linux LTIB BSP. I want the target system can send out an email to external someone or some kind of mail box via the wifi network or wireless 3G/4G modem. I wonder if this SMTP client can solve my requirement? Since you are using Qt5, is it a problem for me to use Qt4.8.4? If you have any suggestion for the Qt4.8.4 platform, please let me know.
Thanks,
Bill -
CONGRATULATIONS TO "This Guy!!!":http://morf.lv
He developed the most simple and useful Qt 5 compatible SMTP Client. -
Hello everyone.
The last post is kinda long ago so I'm hoping the someone will read this:I have an application which is required to send emails. So I setup a local mailserver and pulled bluetiger9's code here:
https://github.com/bluetiger9/SmtpClient-for-Qt
I was able to build a shared .dll file in release Mode. Its 120kb in size.
Could someone kindly help me out now on how I can use this dll in my application?
Lets say i want to use it in my application in debug Mode. It looks like it isnt enough to put the .dll file in the corresponding folder. Im not sure what extra info to include about what I've done. Please let me know -
Hi and welcome to devnet,
Do you mean compile your application to use that library or use it when deploying your application ?
-
Hello!
It's both I guess.
I want to use the functions that lib gives me in my code for my application.When i deploy the application i usually have to provide all neccessary dll files in the same folder (libmysql.dll) for example. So no static linking if thats what you're referring to.
If you look at the github page of my first post. There is an example of its usage right on the front page. I'm trying to achieve to get this example to run properly.
https://github.com/bluetiger9/SmtpClient-for-QtAfter I made my first post I spent the rest of the night tinkering with it and I managed to get something going:
Following this;
https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application
I saw that MinGW (I use MinGW)creates a .dll and a .a file. I copied both those files in the folder containing the project where there supposed to be used. I also copied the header files in the same folder.Here is my .pro file:
QT += core QT -= gui TARGET = SMTPEmailTestDLL CONFIG += console CONFIG -= app_bundle TEMPLATE = app win32:CONFIG (release, debug|release): LIBS += -L$$PWD/ -lSMTPEmail else:win32:CONFIG (debug, debug|release): LIBS += -L$$PWD/ -lSMTPEMail else:unix: LIBS += -L$$PWD/ -lSMTPEmail INCLUDEPATH += $$PWD/ DEPENDPATH += $$PWD/ SOURCES += main.cpp
This actually enabled me to build and run the programm as seen on bluetiger9's github front page.
But, upon running it either terminates with return value -1073741515 or I get the message that "The process to debug couldnt be adressed: wrong parameter"
Weirdly, although receiving those messages, the programm sometimes actually sends an Email out to my gmail Account (be it with a wrong timestamp) as intended, but sometimes it just doenst.
So I might've done something wrong on the way.
I'm sorry if the information I'm giving is somewhat blurry. I appreciate you taking some time for this SGaist! -
I am using this with Qt 5.7. The email is successfuly sent but then I get this error in the end :
Server response code: "221"
Server response: "221 2.0.0 closing connection y144sm8277194wmd.18 - gsmtp\r\n"
error QAbstractSocket::RemoteHostClosedError
stateChanged QAbstractSocket::UnconnectedState
disconneted
error "The TLS/SSL connection has been closed" -
Did you check whether your server uses an outdated protocol that is either not supported anymore or disabled by default for security reasons.
-
opengpu 36 minutes ago
anyone ever used libcurl to send email to smtp server?how many milliseconds it need for sending mail one time?is it fast enough to send email by libcurl in mainThread?
i tried this one, it works. but it's slow, as it needs about 3000 milliseconds for sending email one time.
https://github.com/bluetiger9/SmtpClient-for-Qt