开发者

Compose a new message in the mail app by a clicking a button

开发者 https://www.devze.com 2023-03-31 02:44 出处:网络
I\'m working on a Mac app and I want the user to be able 开发者_运维百科to contact me via email. So I was thinking that there was going to be a button that says contact or something and when the user

I'm working on a Mac app and I want the user to be able 开发者_运维百科to contact me via email. So I was thinking that there was going to be a button that says contact or something and when the user click on the button it will open the mail app and compose a new message that will be sent to my email address already added.

So kinda like an in app mail function that you can add on the iPhone and iPad apps.

Is this possible?


Using NSWorkspace's -openURL: method you can open a standard mailto: link which can include subject and body and it will launch user's default e-mail app (usually Mail) with pre-populated fields.

mailto:you@domain.com?subject=hello&body=text
0

精彩评论

暂无评论...
验证码 换一张
取 消