add 增加 邮件多附件demo

dev
疯狂的狮子Li 1 year ago
parent a8de81aba7
commit 54471dfab0

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.util.Arrays;
/**
@ -49,4 +50,19 @@ public class MailController {
return R.ok();
}
/**
*
*
* @param to
* @param subject
* @param text
* @param paths
*/
@GetMapping("/sendMessageWithAttachments")
public R<Void> sendMessageWithAttachments(String to, String subject, String text, String[] paths) {
File[] array = Arrays.stream(paths).map(File::new).toArray(File[]::new);
MailUtils.sendText(to, subject, text, array);
return R.ok();
}
}

Loading…
Cancel
Save