【发布时间】:2020-09-07 18:24:09
【问题描述】:
我试图在打开邮件应用程序时传递主题和正文,但由于某种原因,当我传递参数时邮件不会发生。谁能在我的代码中看到我做错了什么?或者如果人们有另一种方法让我在 swiftui 中工作,那将是很棒的。感谢您的帮助。
这是我的代码:
Button(action: {
let email = "test@gmail.com"
let subject = "Feedback"
let body = "Please provide your feedback here, and we will contact you within the next 24-48 hours."
guard let url = URL(string: "mailto:\(email)?subject=\(subject)&body=\(body)") else { return }
UIApplication.shared.open(url)
}) {
Text("Contact Us - ")
}
【问题讨论】:
标签: ios swift swiftui uiapplication