0

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 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.(my device is galaxy S2)

this is my reference on creating and sending an email by sir Vinayak.B. see link

Sending Email in Android using JavaMail API without using the default/built-in app

I searched my problem thru google and found out that wifi and 3g connection are blocked to smtp port 465.

Is there anyway or port that I can use to send email via wifi or 3g connection?

Please help.

here is my smtp property

    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"); 
Community
  • 1
  • 1
Japz
  • 73
  • 2
  • 8

1 Answers1

0

I already got the answer using this link

http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_%28no_Intents%29_in_Android

I just used same smtp port for google and I just reconstruct my codes. my app is now sending email.

quinestor
  • 1,394
  • 4
  • 17
  • 40
Japz
  • 73
  • 2
  • 8