我正在使用SendInBlue Java API发送电子邮件,我在scala中编写了以下代码:
object SendInBlueApi extends App{
val http : Sendinblue= new Sendinblue("https://api.sendinblue.com/v2.0","API_KEY");
var data: Map[String, Any]= Map[String, Any]()
data += ("to" -> "[email protected]")
data += ("from" -> "[email protected]")
data += ("subject" -> "My subject")
data += ("text" -> "This is text")
val str = http.send_email(data)
println(str.toString)
}
但我得到这个错误:{“code”:“failure”,“message”:“valid 'to' email address required”,“data”:[]}
1条答案
按热度按时间yacmzcpb1#
这是在map中添加元素的另一种方式: