我有一个申请,google app engine
我abc.appspot.com
可以有一个电子邮件地址来发送/接收电子邮件,比如admin@abc.appspot.com
请帮助我。
编辑
这里是我的SendMail
课
public class SendMail {
private static String fromAddress = "abc@gmail.com";
private static Logger log = Logger.getLogger(SendMail.class.getCanonicalName());
// Send the Mail
public void send(String toAddress, String subject, String msgBody)
throws IOException {
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(fromAddress));
InternetAddress to = new InternetAddress(toAddress);
msg.addRecipient(Message.RecipientType.TO, to);
msg.setSubject(subject);
msg.setText(msgBody);
Transport.send(msg, new InternetAddress[] { to });
} catch (AddressException addressException) {
log.log(Level.SEVERE, "Address Exception , mail could not be sent", addressException);
} catch (MessagingException messageException) {
log.log(Level.SEVERE, "Messaging Exception , mail could not be sent", messageException);
}
}
}
所以它会发送一封电子邮件,abc@gmail.com
但我希望它应该从email@abc.appspot.com
.