0

私は親切に私を助けてくれるような電子メールを送受信するための電子メールアドレスを持っていることができるgoogle app engineようなアプリケーションを持っています.abc.appspot.comadmin@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

4

2 に答える 2

1

の形式でのみメールを受信できます@abc.appspotmail.com@abc.appspot.com私の知る限り、受信アドレスとして持つ方法はありません。

などのカスタム ドメインから電子メールを受信したい場合@abc.com、唯一の方法は、外部の電子メール サービスに電子メールを に転送させること@abc.appspotmail.comです。ほとんどのドメイン レジストラは、転送付きの無料の制限付きメール サービスを提供しています (GoDaddy を使用し、制限付き転送は無料です)。

于 2012-08-10T16:44:51.817 に答える
0

はい、できます: https://developers.google.com/appengine/docs/java/mail/usingjavamail#Senders_and_Recipients

于 2012-08-10T14:30:33.273 に答える