我正在尝试使用 to、cc 和 bcc 发送邮件。我正在使用 javax.mail 来实现这一点。请在下面找到我的代码的一部分
InternetAddress[] myToList = InternetAddress.parse("gopi.mani@xyz.com,Maimsa.SF@xyz.com");
InternetAddress[] myBccList = InternetAddress.parse("Usha.B@xyz.com");
InternetAddress[] myCcList = InternetAddress.parse("NEHA.SIVA@xyz.com");
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(objEmail.getFrom()));
message.setRecipients(Message.RecipientType.TO,myToList);
message.setRecipients(Message.RecipientType.BCC,myBccList);
message.setRecipients(Message.RecipientType.CC,myCcList);
但是当我尝试执行此代码时,出现以下异常:
javax.mail.SendFailedException:无效地址;
嵌套异常是:
com.sun.mail.smtp.SMTPAddressFailedException: 452 4.5.3 收件人太多