smtp - Sending mail from javax.mail in android app -
i working on sending mail broadcast receiver using javax.mail. application sends mail when app running , in foreground. when move application background, error
javax.mail.messagingexception: not connect smtp host: smtp.gmail.com, port: 587; java.net.connectexception: failed connect smtp.gmail.com/74.125.25.108 (port 587): connect failed: enetunreach (network unreachable)
i have made sure broadcast receiver running in background.
just little note, have had trouble doing internet based services broadcastreceiver in past. work 1 time, fail next. can simple slow 3g data or failed post. trouble broadcastreceiver gets aggressively shut down gc in cases , not meant long-running. things fail, or take long, or need retried (like sending email), consider rather starting service broadcastreceiver can continue retry , keepalive in event of failure. not essential, idea (in experience).
Comments
Post a Comment