Hi

What i did ..
In my application , we are trying to send mails.
The user should be able to attach file ...

Problem ...
i have a function called void Smtp::dnsLookupHelper() . Here it is not able to resolve the DNS SERVER NAME in string . say "ourserver.com"
Qt Code:
  1. socket->connectToHost( s.first().name ,25 ); // s.first().name = "ourserver.com"
To copy to clipboard, switch view to plain text mode 

see the code in this void Smtp::dnsLookupHelper()
Qt Code:
  1. void Smtp::dnsLookupHelper()
  2. {
  3. QValueList<QDns::MailServer> s = mxLookup->mailServers();
  4. QValueList<QDns::MailServer>::Iterator it = s.begin();
  5. while( it != s.end() )
  6. {
  7. qDebug("%DNS-Server:"+QString("%1").arg( (*it).name ));
  8. ++it;
  9. }
  10.  
  11.  
  12.  
  13.  
  14.  
  15. if ( s.isEmpty() && mxLookup->isWorking() )
  16. {
  17. emit status( tr( "Could not find mail server. Please check address." ) );
  18. QMessageBox::warning( qApp->activeWindow(),
  19. tr( "SynsupMail" ),
  20. tr( "Could not find mail server for address:\n\n %1" ).arg( rcpt ) );
  21. QTimer::singleShot( 0, this, SLOT(deleteMe()) );
  22. return;
  23. }
  24.  
  25. emit status( tr( "Connecting to %1" ).arg( s.first().name ) );
  26. socket->connectToHost( s.first().name ,25 ); // Not able to resolve the DNS name.
  27. //socket->connectToHost( QString("192.168.45.55"), 25 ); //this will work, as i given the IP address directly
  28. t = new QTextStream( socket );
  29.  
  30. }
To copy to clipboard, switch view to plain text mode 

if am giving the DNS SERVER NAME like this "192.168.45.55" this will work . Why ..????


please help