This is normal:
> By default, messages are logged at Level.INFO and the body of the message
> is excluded.
>
https://developers.google.com/appengine/docs/java/tools/localunittesting/javadoc/com/google/appengine/api/mail/dev/LocalMailService
On Friday, December 21, 2012 1:31:18 PM UTC+1, Moritz wrote:
>
> Hi Group,
>
> in my project, the email body is empty when I run it in a Java unit test.
> I took the example from the docs:
>
> Properties props = *new* Properties();
>
> Session session = Session.getDefaultInstance(props, *null*);
>
> Message msg = *new* MimeMessage(session);
>
> msg.setFrom(*new* InternetAddress("[email protected] <javascript:>
> ", "Example.com Admin"));
>
> msg.addRecipient(Message.RecipientType.TO, *new* InternetAddress("
> [email protected] <javascript:>", "Mr. User"));
>
> msg.setSubject("Your Example.com account has been activated");
>
> msg.setText(".....");
>
> Transport.send(msg);
>
> Which produces the following output:
>
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: MailService.send
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: From: "Example.com Admin" <[email protected] <javascript:>>
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: To: "Mr. User" <[email protected] <javascript:>>
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: Reply-to: "Example.com Admin" <[email protected] <javascript:>>
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: Subject: Your Example.com account has been activated
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: Body:
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: Content-type: text/plain
> Dez 21, 2012 12:24:24 PM
> com.google.appengine.api.mail.dev.LocalMailService log
> INFO: Data length: 5
>
>
> The unit test is initialized using
>
> *protected* LocalServiceTestHelper helper = *new*LocalServiceTestHelper(
> *new* LocalMailServiceTestConfig());
>
> I'm using API version 1.7.3 and the Maven plugin.
>
> You can see, that the body is logged as an empty string, but the "Data
> length" is 5 (which corresponds to the "....." text).
>
> Is this normal or am I missing something?
>
> Thank you & Regards,
> Moritz
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/Uo7V6XdBFjEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.