Unknow SMTP host android JavaMail
<p>I have a Mailserver, which is hosted at the same network as my phone, but I keep getting an exception saying <code>Unknow SMTP host</code>. I've read several places that this exception occurs when the hostname isnt correct spelled, of course. But in this case it <strong>IS</strong>. In <code>C#</code> its done a simple way like this:</p>

<pre><code>var client = new SmtpClient(_strSmtpHost);
client.UseDefaultCredentials = true; 
var mailMessage = new MailMessage(_strFrom, emailTo);
mailMessage.Subject = subject;
mailMessage.Attachments.Add(attachment);
client.Send(mailMessage);
</code></pre>

<p>And in my application its done this way:</p>

<pre><code> SendMail m = new SendMail("Username", "password"); 

      String[] toArr = {"TO@EXAMPLE.com"};   
      m.setTo(toArr); 
      m.setFrom("FROM@EXAMPLE.com"); 
      m.setSubject("This is an email sent using my Mail JavaMail wrapper from an Android device."); 
      m.setBody("Email body."); 

      try { 
        m.addAttachment(fileName); 

        if(m.send()) { 
          Log.i("MAIL SENDER: ", "Succesfully");
        } else { 
              Log.i("MAIL SENDER: ", "UnSuccesfully");
        } 
      } catch(Exception e) { 
        Log.e("MailApp", "Could not send email" + e); 
      } 
</code></pre>

<p>In my SendMail class I define a String containing the <code>DNS</code> address of the host</p>

<pre><code>_host = "napserver"; // default smtp server
_port = "25"; // default smtp port
</code></pre>

<p>Before I try to do a connect, I want to Authenticate username and password for the mail-address sending the mail:</p>

<pre><code>Session session = Session.getInstance(props, new GMailAuthenticator(_user, _pass));
</code></pre>

<p>and then trying to a connect and send message</p>

<pre><code>  Transport transport = session.getTransport("smtp");
  transport.connect(_host, 25, _user, _pass);
  Transport.send(msg);
</code></pre>

<p>Just for testing purposes I tried the <code>SMTP</code> address for Gmail, and this worked, and the mail was sent to the specified mail account. Can anybody give me a hint? </p>

<p><strong>EDIT</strong></p>

<p>I should also mention that I tried to connect via <code>Telnet</code> to this mail server, and the ouput from PuTTy, when connected with the host <code>napserver</code> and port <code>25</code> :</p>

<pre><code>220 napserver.nap01.dac.no.eu-admin.net Microsoft ESMTP MAIL Service, Version: 6                                               .0.3790.3959 ready at  Tue, 7 Aug 2012 13:38:55 -0700
</code></pre>

<p><strong>EDIT 2</strong></p>

<p>As you can see from the PuTTy output:</p>

<pre><code>Microsoft ESMTP MAIL Service
</code></pre>

<p>My mailserver uses the ESMTP, but as far as I know this just implements some security layers and so on. Maybe this is where the error is? </p>

<p><strong>EDIT 3</strong></p>

<p>I tried to access the mailserver via remote desktop, I pinging my phones IP-address just to be sure that the server and the phone is located on the same network, and it is..</p>
