Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]SMTP Authentification
Forum Updated to NodeBB v4.3 + New Features

[Solved]SMTP Authentification

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toho71
    wrote on last edited by
    #1

    Hi
    I have tried this prj in my app but I don't get it to work properly
    ""smtpclient": https://github.com/bluetiger9/SmtpClient-for-Qt":

    I dont. get the mail to be sent in that code,

    Then I have an other code to send mail via SMTP and the main part looks like this
    @SmtpClient::SmtpClient( const QString &from, const QString &to, const QString &subject, const QString &body )
    {
    socket = new QTcpSocket( this );
    connect( socket, SIGNAL(readyRead()), this, SLOT( readyRead() ) );

    connect( socket, SIGNAL( connected() ), this, SLOT( connected() ) );
    connect( socket, SIGNAL(error(QAbstractSocket::SocketError)), this,
    SLOT(errorReceived(QAbstractSocket::SocketError)));
    connect( socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this,
    SLOT(stateChanged(QAbstractSocket::SocketState)));
    connect(socket, SIGNAL(disconnected()), this,
    SLOT(disconnected()));;

    message = "To: " + to + "\n";
    message.append("From: " + from + "\n");
    message.append("Subject: " + subject + "\n");
    message.append("\r\n" + body);
    message.append(body);
    message.replace( QString::fromLatin1( "\n" ), QString::fromLatin1( "\r\n" ) );
    message.replace( QString::fromLatin1( "\r\n.\r\n" ),

    QString::fromLatin1( "\r\n..\r\n" ) );
    this->from = from;
    rcpt = to;
    state = Init;
    //this->Maddress = to.mid( to.indexOf('@',1)+1);

    //QString s= "smtp.";
    //s.append(this->Maddress);
    socket->connectToHost( "192.168.100.1" , 25);

    if(socket->waitForConnected ( 40000 )) {qDebug("connected"); }

    t = new QTextStream( socket );
    }@
    and so on......

    But in this code I'm not sure how to set Authentification to the mailserver when so is needed:

    Is there a simpler way to solve this problem with smtp and mail in qt.
    I have been looking around but I always end up with this two examples

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      Take a look "here":http://libqxt.bitbucket.org/doc/0.6/qxtsmtp.html

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toho71
        wrote on last edited by
        #3

        Looks OK
        Have you used it.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          No, I haven't, but LibQxt extension is not bad at all, should actually work.

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            toho71
            wrote on last edited by
            #5

            Worked perfect for me.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sushant
              wrote on last edited by
              #6

              Hello,

              socket = new QSslSocket(this);

              this line generate a error like "Illegal Instruction";
              i use qt4.6.3 version for ARM baord please help me

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved