Merge remote-tracking branch 'origin/master'

This commit is contained in:
tursom 2022-01-06 09:49:07 +08:00
commit 370fb3d0f4
2 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ plugins {
dependencies { dependencies {
implementation(project(":")) implementation(project(":"))
implementation(group = "com.sun.mail", name = "javax.mail", version = "1.6.2") api(group = "com.sun.mail", name = "javax.mail", version = "1.6.2")
} }

View File

@ -14,9 +14,10 @@ import javax.mail.internet.InternetAddress
data class GroupEmailData( data class GroupEmailData(
var host: String?, var port: Int?, var name: String?, var password: String?, var from: String?, var host: String?, var port: Int?, var name: String?, var password: String?, var from: String?,
var to: Collection<String>?, var subject: String?, var html: String? = null, var text: String? = null, var to: Collection<String>?, var subject: String?, var html: String? = null, var text: String? = null,
var image: Collection<Image>? = null, var attachment: Collection<DataSource>? = null var image: Collection<Image>? = null, var attachment: Collection<DataSource>? = null,
) { ) {
fun send(transportListener: TransportListener? = null) { fun send() = send(null)
fun send(transportListener: TransportListener?) {
if (host == null || port == null || name == null || password == null || from == null || to?.isEmpty() != false || subject == null) return if (host == null || port == null || name == null || password == null || from == null || to?.isEmpty() != false || subject == null) return
val props = Properties() val props = Properties()
// props["mail.debug"] = "true" // 开启debug调试 // props["mail.debug"] = "true" // 开启debug调试