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"
socket->connectToHost( s.first().name ,25 ); // s.first().name = "ourserver.com"
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()
void Smtp::dnsLookupHelper()
{
QValueList<QDns::MailServer> s = mxLookup->mailServers();
QValueList<QDns::MailServer>::Iterator it = s.begin();
while( it != s.end() )
{
qDebug
("%DNS-Server:"+QString("%1").
arg( (*it
).
name ));
++it;
}
if ( s.isEmpty() && mxLookup->isWorking() )
{
emit status( tr( "Could not find mail server. Please check address." ) );
tr( "SynsupMail" ),
tr( "Could not find mail server for address:\n\n %1" ).arg( rcpt ) );
QTimer::singleShot( 0,
this,
SLOT(deleteMe
()) );
return;
}
emit status( tr( "Connecting to %1" ).arg( s.first().name ) );
socket->connectToHost( s.first().name ,25 ); // Not able to resolve the DNS name.
//socket->connectToHost( QString("192.168.45.55"), 25 ); //this will work, as i given the IP address directly
}
void Smtp::dnsLookupHelper()
{
QValueList<QDns::MailServer> s = mxLookup->mailServers();
QValueList<QDns::MailServer>::Iterator it = s.begin();
while( it != s.end() )
{
qDebug("%DNS-Server:"+QString("%1").arg( (*it).name ));
++it;
}
if ( s.isEmpty() && mxLookup->isWorking() )
{
emit status( tr( "Could not find mail server. Please check address." ) );
QMessageBox::warning( qApp->activeWindow(),
tr( "SynsupMail" ),
tr( "Could not find mail server for address:\n\n %1" ).arg( rcpt ) );
QTimer::singleShot( 0, this, SLOT(deleteMe()) );
return;
}
emit status( tr( "Connecting to %1" ).arg( s.first().name ) );
socket->connectToHost( s.first().name ,25 ); // Not able to resolve the DNS name.
//socket->connectToHost( QString("192.168.45.55"), 25 ); //this will work, as i given the IP address directly
t = new QTextStream( socket );
}
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
Bookmarks