我正在嘗試發(fā)送一封電子郵件,其中的值取決于前端表單中的值,但它們始終為空。控制器 @PostMapping("/send") public void sendEmail(Contact contact) throws MessagingException { SimpleMailMessage mailMessage = new SimpleMailMessage(); mailMessage.setTo("test@gmail.com"); mailMessage.setSubject(contact.getSubject()); //This is always null mailMessage.setFrom("arasto.developer@gmail.com"); mailMessage.setText("To confirm ationToken()););"); emailSenderService.sendEmail(mailMessage); }實(shí)體public class Contact { private String email; private String address; private String subject; private String content; public Contact() { } //...getters & setters我的帖子,這給了我200 OK結(jié)果主題未顯示。非常感謝任何關(guān)于我哪里出了問(wèn)題以及如何糾正這個(gè)問(wèn)題的建議。
無(wú)法讀取請(qǐng)求正文
慕無(wú)忌1623718
2024-01-28 17:21:27