I use the following method to send email in the Google App Engine servlet :
void Send_Email(String From,String To,String Message_Text)
{
Properties props=new Properties();
Session session=Session.getDefaultInstance(props,null);
try
{
Message msg=new MimeMessage(session);
msg.setFrom(new InternetAddress(From,"nmjava.com Admin"));
msg.addRecipient(Message.RecipientType.TO,new InternetAddress(To,"Ni , Min"));
msg.setSubject("Servlet Message");
msg.setText(Message_Text);
Transport.send(msg);
}
catch (Exception ex)
{
// ...
}
}
But it doesn't work, have I missed anything ? Has anyone got the email function working ?
Edit : I've fixed the String/Text part, but the email function still doesn't work, it says emails were sent, but I checked my mailbox, none received. I ran it on the Google server, what's wrong ?