-2
電子メールを送受信するプログラムを作成しようとしています。私のコードは、しかし、それはしないときにエラーを生成します。私はワードRecipientTypeに、具体的setRecipientsライン上のエラーを取得する基本的なSMTP電子メールの送信と受信をしようとするとエラーが発生する
import java.io.IOException;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.InternetAddress;
public class Main
{
public static void main(String[] args)
{
Properties p = new Properties();
//p = System.getProperties();
Session s = Session.getInstance(p,null);
try
{
Message m = new MimeMessage(s);
m.setFrom(new InternetAddress("....adress...."));
m.setRecipients(m.RecipientType.TO, InternetAddress.parse("....adress...."));
Transport.send(m);
}
catch (MessagingException e)
{
e.printStackTrace();
}
}
}
、それは「RecipientTypeが解決できないか、フィールドではありません」と言う:
は、ここに私のコードです。私はフォーマットをチェックしましたが、何も間違っているようです。
ありがとうございます。
画面が表示されません。あなたはエラーのテキストを与える必要があります。 – Blorgbeard
しました。エラーは、引用符で囲まれた単語です。 – Impact
ああ、やったよ。謝罪いたします。 – Blorgbeard