我想发送电子邮件给多个人,并希望从电子邮件收件人列表中获取这些电子邮件。
{
"webId": 1001,
"externalKey": null,
"fromEmail": "test@gmail.com",
"fromName": "TEST",
"subject": "hello",
"body": "This is a test mail",
"status": 1,
"sentDate": null,
"sendAttempts": 1,
"permanentFailure": false,
"emailRecipientModel": [
{
"webId": 1101,
"emailId": 1001,
"emailAddress": "tets1@gmail.com",
"status": "PENDING",
"smtpStatusCode": 123,
"recipientType": "TO"
},
{
"webId": 1102,
"emailId": 1001,
"emailAddress": "test2@gmail.com",
"status": "PENDING",
"smtpStatusCode": 123,
"recipientType": "TO"
}
],
}
现在我想得到两个电子邮件收件人的电子邮件地址。
在我的电子邮件模型课上。我有一个电子邮件收件人列表。
现在如何获得电子邮件地址或所有电子邮件收件人。
这是我发送电子邮件的功能。
MimeMessage message = javaMailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message,true);
helper.setFrom(email.getFromEmail());
helper.setTo(email.getEmailRecipient().); // need to add all the recipients here using comma separated list
helper.setSubject(email.getSubject());
helper.setText(email.getBody());
javaMailSender.send(message);
2条答案
按热度按时间luaexgnf1#
kokeuurv2#
假设你的方法
email.getEmailRecipient()
返回可以执行以下操作的字符串列表或