Results 1 to 20 of 35

Thread: Sending email using Qt.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending email using Qt.

    I used the structure from the post #9, taking into account post #11 (especially the second note). I am successfully connecting to the server and sending it those "lines" until it comes to send line number 7 (function PutSendLine(), case 7) - it's an actual message. After this line:
    Qt Code:
    1. response = SendLineAndGrab(message+"\r\n.");
    To copy to clipboard, switch view to plain text mode 
    I'm receiving such a response from a server:
    "550 5.5.2 Unknown command 'Date: Mon, 8 Mar 2010 15:54:26'
    I have tried to remove the date (by commenting one of the first lines in smtp.cpp), but then I received similar response but this time it was aobut "User-Agent: Mozilla Thunderbird 1.0.6...".

    Why is the server sending such responses? How to make it work?

  2. #2
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Sending email using Qt.

    in step 5
    SendLineAndGrab("MAIL FROM: "+from);
    someserver return:
    501 Bad address syntax
    so this line must chang to:
    SendLineAndGrab("MAIL FROM:<"+from+">");

  3. #3

    Default Re: Sending email using Qt.

    How can we add to this code an option to send attached files?

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

    Default Re: Sending email using Qt.

    7-bit encode the attachments using something like Base64 and then attach them to the body of the email as a MIME attachment making sure that the message and each attachment has a different id so that the receiving email client knows how to seperate the parts again.

  5. #5
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending email using Qt.

    See POCO Libraries, its very helpfull
    http://pocoproject.org

  6. #6
    Join Date
    Feb 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending email using Qt.

    thank you very much

  7. #7
    Join Date
    Aug 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows Maemo/MeeGo

    Smile Re: Sending email using Qt.

    Can someone post some working code please? It'd be much appreciated and save the rest of us a lot of time and effort.
    Sure, we could dig at this for a few days and get it to eventually work -- but why climb a mountain when someone's already built an escalator?

    Cheers in advance

  8. #8

    Default Re: Sending email using Qt.

    Quote Originally Posted by fatjuicymole View Post
    7-bit encode the attachments using something like Base64 and then attach them to the body of the email as a MIME attachment making sure that the message and each attachment has a different id so that the receiving email client knows how to seperate the parts again.
    My mayor problem is that i receive an empty file if i do that, i must be doing something wrong

Similar Threads

  1. Replies: 9
    Last Post: 23rd August 2012, 00:01
  2. Replies: 7
    Last Post: 5th January 2009, 08:27
  3. Sending Mail through QProcess
    By KaptainKarl in forum Qt Programming
    Replies: 6
    Last Post: 13th August 2008, 21:51
  4. sending encrypted data via mail using smtp
    By vermarajeev in forum General Programming
    Replies: 20
    Last Post: 14th August 2007, 19:47
  5. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23

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.