is there anyway to Send Email to someone in Qt?
-
@opengpu
the idea is, for example for SmtpClient-for-Qt, the following.You have a gmail account, either provided by yourself or the user inputs his, and you use the client to connect, via socket connection, to gmail.
Then you use the connection to send the raw E-Mail informations ( receiver, topic content, attachments etc) via socket to gmail and they distribute it from there. -
@opengpu
You have asked about sending email from Qt. And been advised to look at a couple of simple SMTP clients for this. That will send emails to anyone/any server.Why do you then start asking about SMTP/IMAP servers? Unless you have some special need for one, you should not be looking at servers at all.
-
-
@opengpu said in is there anyway to Send Email to someone in Qt?:
I want to send email at my Qt app
same difference, the previously mentioned clients should also be able to request from the sever, if new e-mails are available and forward it to your code.
-
POP3 is to receive emails and is obsolete.
IMAP is to receive emails.
SMTP is to send emails.Most servers both private corporate or services (like gmail) provide SMTP.
If that protocol is unavailable the most common reason is that your company is using a very restrictive instance of Microsoft Exchange. In that case you can use EWS with C++/CLI or manually by sending SOAP messages.The main takeaway here is: find out if the email server allows for SMTP and if it does use that
-
@opengpu
You seem to be making things pretty complicated for yourself, possibly because you have not read up on SMTP/POP3/IMAP.Your question is about sending emails, from your Qt app. For that all you need is SMTP client code in your app, and knowledge of which SMTP server you wish it to connect to send the email, e.g
smtp.gmail.com
if you have a Gmail account.POP3/IMAP are for retrieving emails from a server. You have never asked for that. Unless you now need that facility too, forget about them. You need SMTP client only.
-
@opengpu
BTW, I don't know if this will help you, but....In my case the users of my software specify & use there own SMTP server to connect to for sending email. Here is what my interafce looks like for them to specify the necessaries:
I don't know whether in your case you want the user to supply this information for their own SMTP email server, or whether you are supplying the server and hard-coding the values. Either way it shows the sort of parameters you will need to have in order to connect to the SMTP server.
I program in Python/PyQt, not C++. So the SMTP client code I use is provided by a Python library, which won't be of any use to you. But either of the simple SMTP clients you are proposing to use will have a similar interface/parameters.
-
@raven-worx
after cmake and compile error in vs:
simple-mail-master\build\src\simplemail-qt5_autogen\include_Debug\EWIEGA46WW/moc_sender.cpp(197): error C2491: 'SimpleMail::Sender::staticMetaObject': definition of dllimport static data member not allowedvs2017, x64,
Qt\5.12.3\msvc2017_64\lib\cmake\Qt5\Qt5Config.cmake -
@opengpu
i haven't written nor used those 3rd party libs, i just pointed them out.