Results 1 to 11 of 11

Thread: Using Command prompt commands

  1. #1
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Using Command prompt commands

    Hi friends,
    I want to use Command prompt commands in Qt.....Actually i'm trying to send mail via Qt...But it doesn't worked,so i have gone for some other solutions,at that time,i have found that we can send mail from command prompt and it worked too..Now i want to use that command prompt commands in Qt..It should not call Command prompt...Please any one help me.

  2. #2
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Using Command prompt commands

    You can use QProcess to get your commands executed.

    Qt Code:
    1. QString program = "mkdir";
    2. QStringList arguments;
    3. arguments << "CreateDirectory";
    4.  
    5. QProcess *myProcess = new QProcess(parent);
    6. myProcess->start(program, arguments);
    To copy to clipboard, switch view to plain text mode 


    CHEERS

  3. #3
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Using Command prompt commands

    Thanks Mr.karankumar....I'm using like this command prompt "ssmtp mohanakannan.kannan8@gmail.com <recepient1.txt"....recepient1.txt is having "from address" and "to address"...ssmtp only sends mail,i have installed it.Could you please tell me how to use it in Qt(those command prompt commands)..actually i dont have any idea....

  4. #4
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Using Command prompt commands

    According to you...
    ssmtp mohanakannan.kannan8@gmail.com <recepient1.txt this is your command

    so the code will be something like.

    Qt Code:
    1. QString program = "ssmtp";
    2. QStringList arguments;
    3. arguments << "mohanakannan.kannan8@gmail.com";
    4. arguments << "<recepient1.txt";
    5.  
    6. QProcess *myProcess = new QProcess(parent);
    7. myProcess->start(program, arguments);
    To copy to clipboard, switch view to plain text mode 


    CHEERS

  5. The following user says thank you to karankumar1609 for this useful post:

    mohanakannan (3rd July 2013)

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using Command prompt commands

    This will not work as "<" is interpreted by a shell which is not present here.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    mohanakannan (3rd July 2013)

  8. #6
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Using Command prompt commands

    Thank you Mr.karankumar and Mr.Wyotsa..I will try it and will tell the result..

  9. #7
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Using Command prompt commands

    Thanks ,
    How to add the configuration file in Qt.....Actually during sending mail via command prompt,It works by means of a configure file (ssmp.conf)..It only has lot of details about AuthUser, Authpass, EnableTLS.....how to add these at all...Thats why i'm asking how to add Config file in Qt.....Thanks in advance

  10. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using Command prompt commands

    This is a forum devoted to Qt, not ssmp. If you have problems with the latter, don't ask here, we have no experience with using this software.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #9
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Using Command prompt commands

    sorry Mr.Wyotso,It is not ssmp,its "ssmtp.conf"....Its a file,i want to use that file "ssmtp.conf" in Qt...

  12. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using Command prompt commands

    Quote Originally Posted by mohanakannan View Post
    sorry Mr.Wyotso,It is not ssmp,its "ssmtp.conf"....
    Whatever...

    Its a file,i want to use that file "ssmtp.conf" in Qt...
    Qt Code:
    1. QFile f("ssmtp.conf");
    2. f.open(QFile::ReadOnly);
    3. QByteArray ba = f.readAll();
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. The following user says thank you to wysota for this useful post:

    mohanakannan (3rd July 2013)

  14. #11
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Using Command prompt commands

    Thank you very much Mr.Wysoto.....Thinking that,it will work..........Any doubts,i will ask you


    Added after 1 49 minutes:


    Hi Mr.Wyotso, I've tried your code and its working....Working in the sense,using qDebug( ),i have shown all the lines in that file.....I have told earlier that i have send the mail in command prompt using "ssmtp"...It is the only reason for sending mail...By using this command(ssmtp recipient_mail@gmail.com),it is possible....I have installed that ssmtp.....It is only having that ( ssmtp.conf ) file..Thats why i've asked how to use it. But now my problem is How to use those command ssmtp recipient_mail@gmail.com in this Qt,by that we can send mail in Qt......Thanks for your response..
    Last edited by mohanakannan; 3rd July 2013 at 16:12.

Similar Threads

  1. Replies: 7
    Last Post: 20th October 2012, 13:44
  2. Qt Command Prompt
    By stijn in forum Installation and Deployment
    Replies: 0
    Last Post: 4th June 2012, 14:15
  3. Replies: 5
    Last Post: 10th January 2011, 00:19
  4. Qt Command Prompt and Recompiling
    By vbman213 in forum Newbie
    Replies: 1
    Last Post: 6th February 2010, 09:49
  5. how to avoid command prompt while reunning EXE ?
    By rajeshs in forum Qt Programming
    Replies: 12
    Last Post: 26th March 2008, 08:22

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.