Results 1 to 15 of 15

Thread: send an email from my Qt application

  1. #1
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default send an email from my Qt application

    hy,
    I need to send an email from my Qt application, but but I don't know where to begin

    I use WinXP with Qt4.2.2 ( Visual Studio 2005 C++ )

    thanks

  2. #2
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: send an email from my Qt application

    Quote Originally Posted by omega36 View Post
    hy,
    I need to send an email from my Qt application, but but I don't know where to begin

    I use WinXP with Qt4.2.2 ( Visual Studio 2005 C++ )

    thanks
    QTcpSocket, and "SMTP" (Simple Mail Transfer Protocol)

    SMTP server often listen on port 25...

  3. #3
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Thanks
    48
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: send an email from my Qt application

    See this post: http://www.qtcentre.org/forum/f-qt-p...g-qt-2221.html
    Attached Files Attached Files
    Last edited by tpf80; 19th December 2008 at 23:09. Reason: found where I got info from.

  4. #4
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application

    thanks I try with this

  5. #5
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application

    I come not to compile the exemple,
    I Have a problem in the file " qthread_p.h",
    #include "qplatformdefs.h" not found

  6. #6
    Join Date
    Oct 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: send an email from my Qt application

    Hello,
    I wrote this class ( with other people ) wich works well
    Here is the link: http://forum.qtfr.org/attachment.php?item=228

  7. #7
    Join Date
    Oct 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: send an email from my Qt application

    Sorry wrong link
    the good one: http://forum.qtfr.org/attachment.php?item=200

  8. #8
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application

    in this exemple , you use Qt4.3,
    I work with Qt4.2.2 so I dont have "QAuthenticator" includ


    I m right ?
    Last edited by omega36; 20th December 2008 at 12:17.

  9. #9
    Join Date
    Oct 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: send an email from my Qt application

    Yes you are right. Authenticator is used for proxy authentification.
    As far as I know, noone as never try this class with a proxy ( I don't).
    This is a very particular case so I think you can comment sections about authenticator and get the class to compile.

  10. #10
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application

    ok I did wath you say, and now I have the same problem with an other includ
    #include <QSslSocket>

    ( and may be others includ of Qt4.3 )

    ideas ?

  11. #11
    Join Date
    Oct 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: send an email from my Qt application

    Yes,
    The QSslSocket aims at support ssl with SMTP
    You've got two options: recompile Qt with openssl support or delete everything about QSslSocket and use only QTcpSocket. In this case you cannot connect to SMTP servers that required SSL.

    As before, this a particular case and most SMTP servers accept non encrypted connections. I think this as nothing to do with Qt 4.3, I'm quite sure you can compile Qt with SSL
    Last edited by yonnak; 20th December 2008 at 13:24. Reason: Precision

  12. #12
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: send an email from my Qt application

    Alternatively, see that application:

    http://www.qt-apps.org/content/show....?content=91315

  13. #13
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: send an email from my Qt application

    If all you want to do is -send- an e-mail from your application, it is very easy to use QDesktopServices:

    Qt Code:
    1. QString strMailTo( "mailto:someone@someAddress.com?subject='My E-mail example'&body=" );
    2. strMailTo += "Hi! This is the body of the e-mail";
    3. bool bResult = QDesktopServices::openUrl( QUrl( strMailTo ) );
    To copy to clipboard, switch view to plain text mode 

    The QUrl constructor will convert the "strMailTo" string into a proper URL (that is, replace spaces by %20%, and so forth). The Boolean result tells you whether the call succeeded or not.

    Forget all this stuff about sockets, TCP, SMTP, and so on.

    David

  14. #14
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application

    very thanks to all,
    Quote Originally Posted by yonnak View Post
    Yes,
    The QSslSocket aims at support ssl with SMTP
    You've got two options: recompile Qt with openssl support or delete everything about QSslSocket and use only QTcpSocket. In this case you cannot connect to SMTP servers that required SSL.

    As before, this a particular case and most SMTP servers accept non encrypted connections. I think this as nothing to do with Qt 4.3, I'm quite sure you can compile Qt with SSL
    Ok I wil see for the second option

    Quote Originally Posted by d_stranz View Post
    If all you want to do is -send- an e-mail from your application, it is very easy to use QDesktopServices:


    Qt Code:
    1. QString strMailTo( "mailto:someone@someAddress.com?subject='My E-mail example'&body=" );
    2. strMailTo += "Hi! This is the body of the e-mail";
    3. bool bResult = QDesktopServices::openUrl( QUrl( strMailTo ) );
    To copy to clipboard, switch view to plain text mode 
    I need to send an attach file .
    Last edited by omega36; 22nd December 2008 at 11:39.

  15. #15
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: send an email from my Qt application


    NoBody!

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 13:35
  2. how to write application which retrieve email from INBOX
    By amit_pansuria in forum KDE Forum
    Replies: 2
    Last Post: 4th June 2007, 15:10
  3. send email and to annex files
    By henriquez0 in forum Qt Programming
    Replies: 8
    Last Post: 29th December 2006, 19:45
  4. Replies: 3
    Last Post: 6th February 2006, 18:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.