Straight zero utilizations means the email api is not accepting your requests rather than the message getting lost in transit. Where the error goes is not obvious due to Issue 1800 I suggest continuing to replace your fields with static values to see which one is not accepted. My gut says to check the character set - UTF-8 works fine for me. Otherwise you may be encountering a known issue with the mail server: http://code.google.com/p/googleappengine/issues/list?can=2&q=component%3DMail&colspec=ID+Type+Component+Status+Stars+Summary+Language+Priority+Owner+Log&cells=tiles
Here is my code, I've embedded it into a queue task and it works thousands of times daily. Message msg = new MimeMessage(session); msg.setFrom(new InternetAddress(fromAddress, fromName)); msg.addRecipient(Message.RecipientType.TO, new InternetAddress( toAddress, toName )); msg.setReplyTo( ADMIN_ADDRESSES ); msg.addHeader( "Return-Path" , ADMIN_ADDRESS ); if ( bccSupport != null && !bccSupport.isEmpty() ) { // only add support bcc if specified msg.addRecipient( Message.RecipientType.BCC, new InternetAddress( bccSupport > )); } msg.setSubject(subject); msg.setText( body ); Transport.send(msg); <http://code.google.com/p/googleappengine/issues/list?can=2&q=component%3DMail&colspec=ID+Type+Component+Status+Stars+Summary+Language+Priority+Owner+Log&cells=tiles> On Thu, Dec 16, 2010 at 10:01 PM, Moretto <mala...@gmail.com> wrote: > As you see the first time i've deployed my app, 2 email were sent. It > appeared at my cota details. Now Could you post your headers details? > > Mail API Calls 0% 0 of 7,000 Okay > Recipients Emailed 0% 0 of 2,000 Okay > Admins Emailed 0% 0 of 5,000 Okay > Message Body Data Sent 0% 0.00 of 0.06 GBytes Okay > Attachments Sent 0% 0 of 2,000 Okay > Attachment Data Sent 0% 0.00 of 0.10 GBytes Okay > > On Dec 17, 2:21 am, "A. Stevko" <andy.ste...@gmail.com> wrote: > > I have much the same code although I set more headers. > > How about adding yourself as a BCC and/or CC? > > Also, do you see any utilization in your Quota details - Mail API Calls > > and Recipients Emailed ? > > > > > > > > On Thu, Dec 16, 2010 at 8:12 PM, Moretto <mala...@gmail.com> wrote: > > > Still no messages....and no errors > > > > > Properties props = new Properties(); > > > Session session = Session.getDefaultInstance(props, null); > > > > > // UserService userService = > > > UserServiceFactory.getUserService(); > > > // User user = userService.getCurrentUser(); > > > try { > > > Message msg = new MimeMessage(session); > > > //msg.setFrom(new InternetAddress(user.getEmail())); > > > msg.setFrom(new InternetAddress("mala...@gmail.com", "[k- > > > share]")); > > > msg.addRecipient(Message.RecipientType.TO, > > > new InternetAddress(email, destinatario)); > > > msg.setSubject(titulo); > > > msg.setText(texto); > > > Transport.send(msg); > > > > > } catch (AddressException e) { > > > e.printStackTrace(); > > > return false; > > > } catch (MessagingException e) { > > > e.printStackTrace(); > > > return false; > > > } catch (Exception e) { > > > e.printStackTrace(); > > > return false; > > > } > > > return true; > > > > > On Dec 17, 2:03 am, Moretto <mala...@gmail.com> wrote: > > > > "can send email messages on behalf of the app's administrators, and > on > > > > behalf of users with Google Accounts." > > > > > > UserService userService = UserServiceFactory.getUserService(); > > > > User user = userService.getCurrentUser(); > > > > > > These two lines of code retrieve the current google user logged in. > > > > i'll change it and test. > > > > > > On Dec 17, 1:52 am, "A. Stevko" <andy.ste...@gmail.com> wrote: > > > > > > > I now recall the conditions... > > >http://code.google.com/appengine/docs/java/mail/overview.html > > > > > > > > App Engine applications can send email messages on behalf of the > > > app's > > > > > > administrators, and on behalf of users with Google Accounts. > > > > > On Thu, Dec 16, 2010 at 7:49 PM, A. Stevko <andy.ste...@gmail.com> > > > wrote: > > > > > > Does the email address used in your From have administrator > > > privileges for > > > > > > your app? > > > > > > > > msg.setFrom(new InternetAddress(user.getEmail())); > > > > > > > > I read somewhere that system could only send email from > registered > > > email > > > > > > addresses. > > > > > > > > On Thu, Dec 16, 2010 at 7:13 PM, Moretto <mala...@gmail.com> > wrote: > > > > > > > >> I've changed the code to initialize the Session object passing > > > > > >> properties as a parameter. Nothing changed. Still does not send > > > emails > > > > > >> and doesnt throws any exception. Ideias?? > > > > > > > >> Properties props = new Properties(); > > > > > >> Session session = Session.getDefaultInstance(props, > null); > > > > > > > >> UserService userService = > > > UserServiceFactory.getUserService(); > > > > > >> User user = userService.getCurrentUser(); > > > > > >> try { > > > > > >> Message msg = new MimeMessage(session); > > > > > >> msg.setFrom(new InternetAddress(user.getEmail())); > > > > > >> msg.addRecipient(Message.RecipientType.TO, > > > > > >> new InternetAddress(email, destinatario)); > > > > > >> msg.setSubject(titulo); > > > > > >> msg.setText(texto); > > > > > >> Transport.send(msg); > > > > > > > >> } catch (AddressException e) { > > > > > >> e.printStackTrace(); > > > > > >> return false; > > > > > >> } catch (MessagingException e) { > > > > > >> e.printStackTrace(); > > > > > >> return false; > > > > > >> } catch (Exception e) { > > > > > >> e.printStackTrace(); > > > > > >> return false; > > > > > >> } > > > > > >> return true; > > > > > > > >> On Dec 14, 12:11 pm, Amit Pandey <amit.s...@gmail.com> wrote: > > > > > >> > Just try creating session object using property object. May be > it > > > can > > > > > >> > help(Not sure). > > > > > > > >> > Properties props = new Properties(); > > > > > >> > Session session = Session.getDefaultInstance(props, > null); > > > > > > > >> > On Tue, Dec 14, 2010 at 9:21 AM, Moretto <mala...@gmail.com> > > > wrote: > > > > > >> > > Hi, > > > > > > > >> > > I'm using JAVAMAIL to send mail from my GAE app located at > > > > > >> > >http://k-share.appspot.com/. > > > > > > > >> > > I can't send email and no error occurs. The first time i've > > > deployed > > > > > >> > > my app, it send 2 email then no more. > > > > > > > >> > > Take a look at the source code below: > > > > > > > >> > > /* > > > > > >> > > * To change this template, choose Tools | Templates > > > > > >> > > * and open the template in the editor. > > > > > >> > > */ > > > > > >> > > package com.appspot.kshare.control; > > > > > > > >> > > import com.google.appengine.api.users.User; > > > > > >> > > import com.google.appengine.api.users.UserService; > > > > > >> > > import com.google.appengine.api.users.UserServiceFactory; > > > > > >> > > import java.io.UnsupportedEncodingException; > > > > > >> > > import javax.mail.Message; > > > > > >> > > import javax.mail.MessagingException; > > > > > >> > > import javax.mail.Session; > > > > > >> > > import javax.mail.Transport; > > > > > >> > > import javax.mail.internet.AddressException; > > > > > >> > > import javax.mail.internet.InternetAddress; > > > > > >> > > import javax.mail.internet.MimeMessage; > > > > > > > >> > > /** > > > > > >> > > * > > > > > >> > > * @author malacma > > > > > >> > > */ > > > > > >> > > public class EmailControlUtil { > > > > > > > >> > > public static boolean sendMail(String email, String > > > destinatario, > > > > > >> > > String titulo, String texto, Object anexo) throws > > > > > >> > > UnsupportedEncodingException { > > > > > >> > > Session session = Session.getDefaultInstance(null); > > > > > > > >> > > UserService userService = > > > UserServiceFactory.getUserService(); > > > > > >> > > User user = userService.getCurrentUser(); > > > > > >> > > try { > > > > > >> > > Message msg = new MimeMessage(session); > > > > > >> > > msg.setFrom(new > InternetAddress(user.getEmail())); > > > > > >> > > msg.addRecipient(Message.RecipientType.TO, > > > > > >> > > new InternetAddress(email, > destinatario)); > > > > > >> > > msg.setSubject(titulo); > > > > > >> > > msg.setText(texto); > > > > > >> > > Transport.send(msg); > > > > > > > >> > > } catch (AddressException e) { > > > > > >> > > e.printStackTrace(); > > > > > >> > > return false; > > > > > >> > > } catch (MessagingException e) { > > > > > >> > > e.printStackTrace(); > > > > > >> > > return false; > > > > > >> > > } catch (Exception e) { > > > > > >> > > e.printStackTrace(); > > > > > >> > > return false; > > > > > >> > > } > > > > > >> > > return true; > > > > > >> > > } > > > > > >> > > } > > > > > > > >> > > Any ideia? Need help hurry :( > > > > > > > >> > > -- > > > > > >> > > You received this message because you are subscribed to the > > > Google > > > > > >> Groups > > > > > >> > > "Google App Engine for Java" group. > > > > > >> > > To post to this group, send email to > > > > > >> > > google-appengine-j...@googlegroups.com. > > > > > >> > > To unsubscribe from this group, send email to > > > > > >> > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com><google-appengine-java%2B > unsubscr...@googlegroups.com><google-appengine-java%2B > > > unsubscr...@googlegroups.com><google-appengine-java%2B > > > > > >> unsubscr...@googlegroups.com> > > > > > >> > > . > > > > > >> > > For more options, visit this group at > > > > > >> > >http://groups.google.com/group/google-appengine-java?hl=en. > > > > > > > >> -- > > > > > >> You received this message because you are subscribed to the > Google > > > Groups > > > > > >> "Google App Engine for Java" group. > > > > > >> To post to this group, send email to > > > > > >> google-appengine-j...@googlegroups.com. > > > > > >> To unsubscribe from this group, send email to > > > > > >> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com><google-appengine-java%2B > unsubscr...@googlegroups.com><google-appengine-java%2B > > > unsubscr...@googlegroups.com> > > > > > >> . > > > > > >> For more options, visit this group at > > > > > >>http://groups.google.com/group/google-appengine-java?hl=en. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Google App Engine for Java" group. > > > To post to this group, send email to > > > google-appengine-j...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com><google-appengine-java%2B > unsubscr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-appengine-java?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > google-appengine-j...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.