Results 1 to 15 of 15

Thread: send an email from my Qt application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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 12:24. Reason: Precision

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

    Default Re: send an email from my Qt application

    Alternatively, see that application:

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

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    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

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

    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 10:39.

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

    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, 12: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, 14:10
  3. send email and to annex files
    By henriquez0 in forum Qt Programming
    Replies: 8
    Last Post: 29th December 2006, 18:45
  4. Replies: 3
    Last Post: 6th February 2006, 17: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
  •  
Qt is a trademark of The Qt Company.