views:

29

answers:

2

I'm using javamail to send mails from my appengine application. It works perfectly in the deployment, but I can't figure out how to do this using the development server. Whenever I need to test the sendmail, I'm having to deploy the application which is quite annoying.

+2  A: 

From the docs:

When an application running in the development server calls the Mail service to send an email message, the message is printed to the log. The Java development server does not send the email message.

So just check the logs when you intend to send mail, and make sure that it shows up there. No real mail will actually get sent.

Jason Hall
This won't do because I need to check other things too; whether the message is formatted right, whether attachments are downloadable and whether the mail is getting delivered in the first place.
manu1001
You can't do that kind of integration testing with the development server. I suggest you to either set up that in the deployment with for example a separate app or use your own mail server instead of App Engine APIs.
hleinone
A: 

From Eclipse, select the Run menu, Debug Configurations..., and then select your app’s configuration. Select the Arguments tab, then in the “VM arguments” section, set VM properties like this:

-Dmail.log_mail_level=WARNING -Dmail.log_mail_body=true

zawhtut