title: How to send email(Gmailsend,JSSEProvider) using wifi and 3g(HSDPA,GPRS) connection on android
body: <p>I created an automation application that send an email to a certain recipient, I use the emulator(eclipse indigo AVD) on my pc that has an internet connection and it will send an email and the recipient will received it, but my <strong>problem is this when I use my application on my device(phone) that has an Internet(wifi connection and 3g(HSDPA,GPRS)) it does not send email. Its very weird, on pc emulator its running correctly but on my device It does not send.</strong>(my device is galaxy S2)</p>
  
  <p>this is my reference on creating and sending an email by sir Vinayak.B. see link</p>
  
  <p><a href="https://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a">Sending Email in Android using JavaMail API without using the default/built-in app</a></p>
  
  <p>I searched my problem thru google and found out that wifi and 3g connection are blocked to smtp port 465.</p>
  
  <p>Is there anyway or port that I can use to send email via wifi or 3g connection?</p>
  
  <p>Please help.</p>
  
  <p>here is my smtp property</p>
  
  <pre><code>    private String mailhost = "smtp.gmail.com";
      Properties props = new Properties();   
      props.setProperty("mail.transport.protocol", "smtp");   
      props.setProperty("mail.host", mailhost);   
      props.put("mail.smtp.auth", "true");   
      props.put("mail.smtp.port", "465");   
      props.put("mail.smtp.socketFactory.port", "465");   
      props.put("mail.smtp.socketFactory.class",   
              "javax.net.ssl.SSLSocketFactory");   
      props.put("mail.smtp.socketFactory.fallback", "false");   
      props.setProperty("mail.smtp.quitwait", "false"); 
  </code></pre>