Results 1 to 4 of 4

Thread: How to run a new e-mail message (ex. in outlook) with attach file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default How to run a new e-mail message (ex. in outlook) with attach file

    Hello!

    I'ld like to run (in QT command) a new e-mail message (ex.outlook) with a attach file from example C:\test\test.pdf. How can I do it?

    1. how to run default e-mail klient?
    2. how to add automaticly a attach file?

    Big thanks!
    Last edited by TomASS; 29th October 2009 at 11:39.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run a new e-mail message (ex. in outlook) with attach file

    Have you tried url handler with mailto: URL?

  3. #3
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run a new e-mail message (ex. in outlook) with attach file

    Quote Originally Posted by fatjuicymole View Post
    Have you tried url handler with mailto: URL?
    How can I attach the file?

    I've:
    Qt Code:
    1. QDesktopServices::openUrl(QUrl::QUrl("mailto:user@foo.com?subject=Test&body=Just a test&attach='c:\\tomek.txt'"));
    To copy to clipboard, switch view to plain text mode 
    and unfortunately isn't work :/

    Any others ideas?
    Last edited by TomASS; 29th October 2009 at 13:56.

  4. #4
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run a new e-mail message (ex. in outlook) with attach file

    On the other hand, when I'm trying lunch outlook.exe by:
    Qt Code:
    1. QProcess* foo= new QProcess( this );
    2. foo->setProcessChannelMode(QProcess::MergedChannels);
    3. foo->setEnvironment( QProcess::systemEnvironment() );
    4. foo->start( "outlook.exe" );
    5.  
    6. if( !foo->waitForFinished() ) {
    7. qDebug() << QDir( foo->workingDirectory() ).entryList();
    8. qDebug() << "Fail:" << foo->errorString();
    9. qDebug() << "Exit = " << foo->exitCode();
    10. } else {
    11. qDebug() << "Output:" << foo->readAll();
    12. }
    To copy to clipboard, switch view to plain text mode 
    I take a "Process failed to start" despite the fact that if i type "outlook.exe" in Stat->run it's working :/

Similar Threads

  1. Open outlook attach (.txt) in Qtextedit
    By assismvla in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2008, 15:45
  2. Replies: 4
    Last Post: 17th June 2007, 10:30
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.