私は親切に私を助けてくれるような電子メールを送受信するための電子メールアドレスを持っていることができる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
。