Google App Engine Email
Posted
by Frank
on Stack Overflow
See other posts from Stack Overflow
or by Frank
Published on 2010-04-23T01:31:09Z
Indexed on
2010/04/23
1:33 UTC
Read the original article
Hit count: 407
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 ?
© Stack Overflow or respective owner