如何在不使用任何电子邮件客户端的情况下从 Cocoa 应用程序发送电子邮件?我有 NSURL 但它会打开一个电子邮件客户端。我希望在不发生这种情况的情况下发送电子邮件。
最佳答案
那些响应已经过时 Mac OS X 10.8 和更多你应该使用 NSSharingService
NSArray *shareItems=@[body,imageA,imageB];
NSSharingService *service = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail];
service.delegate = self;
service.recipients=@[@"xxx@apple.com"];
service.subject= [ NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"SLYRunner console",nil),currentDate];
[service performWithItems:shareItems];
关于objective-c - 从 Cocoa 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5461648/