Results 1 to 12 of 12

Thread: Sending Mail

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    9
    Thanked 1 Time in 1 Post

    Default Re: Sending Mail

    Quote Originally Posted by wysota View Post
    This code is Qt4 code.
    Ok.
    I get the following error on compile:
    Qt Code:
    1. smtp.h: In constructor ‘Smtp::Smtp(const QString&, const QString&, const QString&, const QString&)’:
    2. smtp.h:79: error: no match for call to ‘(QDebug) (const char [10])’
    3. make: *** [main.o] Error 1
    To copy to clipboard, switch view to plain text mode 

    Here is the problem:
    Qt Code:
    1. if( socket->waitForConnected( 30000 ) )
    2. qDebug()("connected");
    To copy to clipboard, switch view to plain text mode 

    And won't work with
    Qt Code:
    1. if( socket->waitForConnected( 30000 ) )
    2. qDebug() << "connected";
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files
    Last edited by systemz89; 9th December 2007 at 12:27. Reason: updated contents

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Sending Mail

    include <QtDebug>

  3. #3
    Join Date
    Jul 2007
    Posts
    166
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default Re: Sending Mail

    Hi,
    Please write details of your Qt version and OS. If it is Linix, Then you configure a mail server in your system and write the details to a file, What you need to send as a mail and use this command for send it as a mail
    system("cat YourFileName.txt | mail -s \" Your Subject \" to_email_id@xxx.com");

    After this you remove your test file.

  4. #4
    Join Date
    Feb 2008
    Posts
    50
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Sending Mail

    The Smtp class which systemz89 provided is working. Thanx for saving me time.
    Only changed to qDebug() << "connected"; made the class separated to .h and .cpp, and added main.cpp for execution. Then i tested it with local smtp server and it worked.
    Now i should think how to make TLS AUTH to some smtp server too.
    Last edited by sadjoker; 15th June 2008 at 02:25.

  5. #5
    Join Date
    May 2006
    Posts
    788
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 48 Times in 46 Posts

    Default Re: Sending Mail

    Quote Originally Posted by sadjoker View Post
    The Smtp class which systemz89 provided is working. Thanx for saving me time.
    Only changed to qDebug() << "connected"; made the class separated to .h and .cpp, and added main.cpp for execution. Then i tested it with local smtp server and it worked.
    Now i should think how to make TLS AUTH to some smtp server too.

    Have a look on:
    http://qt-webdav.svn.sourceforge.net..._auth_console/
    i write this chunk and work on qmail server auth smtp + formated html text mail

  6. #6
    Join Date
    Feb 2008
    Posts
    50
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Sending Mail

    thanx, i`ll have a look.
    I decided to try the next thing:
    i got the "Free SMTP Server" app... i`ll try to call it with QProcess from my app, then send the mail trough it and close the process. no need to use anyone else smtp servers.

Similar Threads

  1. sending encrypted data via mail using smtp
    By vermarajeev in forum General Programming
    Replies: 20
    Last Post: 14th August 2007, 19:47
  2. how to read Email from INBOX
    By amit_pansuria in forum Qt Programming
    Replies: 22
    Last Post: 7th June 2007, 06:40
  3. Sending mail using Qt
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 18th December 2006, 11:17
  4. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23
  5. Did you people get the unsolicited mail? - "Release of Makedoc"
    By jamadagni in forum General Discussion
    Replies: 5
    Last Post: 14th February 2006, 12:46

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.