if ( state == Init && responseLine == "220" ){ *(this->_strm) << "EHLO " << this->_mailInfo.host << "\r\n"; (this->_strm)->flush(); state = Mail; }else{ if ( state == Mail && responseLine == "250" ){ *(this->_strm) << "MAIL FROM: " << this->_mailInfo.senderEMail << "\r\n"; (this->_strm)->flush(); state = Rcpt; }else{ if ( state == Rcpt && (responseLine == "250" || responseLine == "251") ){ qDebug ()<<"rcpt2"<< "RCPT TO:<" << this->_mailInfo.recipients << ">\r\n"; *(this->_strm) << "RCPT TO: <" << this->_mailInfo.recipients << ">\r\n"; (this->_strm)->flush(); state = Data; }else{ if ( state == Data && (responseLine == "250" || responseLine == "251") ){ qDebug ()<<"data"; *(this->_strm) << "DATA\r\n"; (this->_strm)->flush(); state = Body; }else{ if ( state == Body && responseLine == "354" ){ qDebug ()<<"body1"; QString message = this->_generateHeader(); qDebug()<<message; *(this->_strm) << message << "\n" << "\r\n.\r\n"; (this->_strm)->flush(); state = Quit; }else{ qDebug ()<<"body2"; if ( state == Quit && responseLine == "250" ){ *(this->_strm) << "QUIT\r\n"; (this->_strm)->flush(); emit status( tr( "Message sent" ) ); } } } } } }}