1

In my application I have use GmailSender activity. By using that i can send email very well with Activity.

Now I want to send email in Background i.e. at particular time using service. I tried to make object of that GmailSender class and used its sendMail method to send mail in Service. but however it does not execute.

Please give me solution for schedule the email sending using service.

EDIT:

I have tried that GmailSender in other program with Activity and it works well but in the program which i am currently working it don't work with service.

The exception i get is :

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
04-20 11:53:36.693: VERBOSE/sendMail method(710):   nested exception is:
04-20 11:53:36.693: VERBOSE/sendMail method(710):     java.net.SocketException: Permission denied 

and for above error i have tried this link too but its not working with me.

--Thanks RB

2
  • 3
    If the code "does not execute", try running the code. If the code gives you errors, consider editing your question with error information. Commented Apr 19, 2011 at 20:23
  • @CommonsWare : Thanks for above comment. i have used log to trace exception. please check out Edited post for that. Commented Apr 20, 2011 at 6:50

1 Answer 1

2

You are probably missing the INTERNET permission in your manifest.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.