无法使用 SwiftMailGun 从 UITextField 发送文本
Cant send text from UITextField using SwiftMailGun
我正在尝试从 UITextField
向电子邮件发送一些文本,但它什么也没发送,但是当我使用 textView 时一切正常。这是部分代码:
@IBAction func sendButton(sender: UIButton) {
let mailgun = MailgunAPI(apiKey: "key-*************",
clientDomain: "*********.mailgun.org")
mailgun.sendEmail(to: "**********@gmail.com", from: self.tema.text!, subject: self.message.text!, bodyHTML: "<b>test<b>") { mailgunResult in
if mailgunResult.success{
print("Email was sent")
print(self.tema.text!)
print(self.message.text!)
}
}
}
控制台输出如下:
enter image description here
糟糕!那是我的失败!
@IBAction func sendButton(sender: UIButton) {
let mailgun = MailgunAPI(apiKey: "key-***************",
clientDomain: "sandbox***************.mailgun.org")
mailgun.sendEmail(to: "mdmabook@gmail.com", from: "Test User <test@test.com>", subject: message.text!, bodyHTML: tema.text!) { mailgunResult in
if mailgunResult.success{
print("Email was sent")
print(self.tema.text!)
print(self.message.text!)
}
}
}
我正在尝试从 UITextField
向电子邮件发送一些文本,但它什么也没发送,但是当我使用 textView 时一切正常。这是部分代码:
@IBAction func sendButton(sender: UIButton) {
let mailgun = MailgunAPI(apiKey: "key-*************",
clientDomain: "*********.mailgun.org")
mailgun.sendEmail(to: "**********@gmail.com", from: self.tema.text!, subject: self.message.text!, bodyHTML: "<b>test<b>") { mailgunResult in
if mailgunResult.success{
print("Email was sent")
print(self.tema.text!)
print(self.message.text!)
}
}
}
控制台输出如下: enter image description here
糟糕!那是我的失败!
@IBAction func sendButton(sender: UIButton) {
let mailgun = MailgunAPI(apiKey: "key-***************",
clientDomain: "sandbox***************.mailgun.org")
mailgun.sendEmail(to: "mdmabook@gmail.com", from: "Test User <test@test.com>", subject: message.text!, bodyHTML: tema.text!) { mailgunResult in
if mailgunResult.success{
print("Email was sent")
print(self.tema.text!)
print(self.message.text!)
}
}
}