[appengine-java] sending mails using appengine mail service

2010-02-27 Thread santosh mantri
hello everyone,
I am trying to send mail using app engine mail service but its not
happening for me..can anybody help me...
I have tried the example snippet from appengine...

-- 
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.



[appengine-java] Re: sending mail in google app engine in java

2010-02-27 Thread santosh mantri
Hi laxmi,
I'm also trying to send mail thru appengine.
My code is as follows

package outlooky;

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;
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;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

class AuthServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;

public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
BufferedReader rd = null;
rd  = new BufferedReader(new
InputStreamReader(req.getInputStream()));
String msgBody = new String(rd.readLine());
sendEmail(msgBody);

}
public void sendEmail(String title) {
Properties props = new Properties();
  Session session = Session.getDefaultInstance(props, null);

  try {
  Message msg = new MimeMessage(session);
  msg.setFrom(new InternetAddress(outlooky-te...@appspot.com));
  msg.addRecipient(Message.RecipientType.TO,new
InternetAddress(sandy1man...@gmail.com));
  msg.setSubject(the wave  + title +  was updated);
  msg.setText(it was updated!);
  Transport.send(msg);
  }
  catch (AddressException e)
  {
  // ...
  }
  catch (MessagingException e)
  {
  // ...
  }
}
}


But I'm not getting any logs in my app and also its not showing me any
sent mail...
can u tell me where is the actual problem is?

-- 
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.