应用内邮件帐户选择

发布于 2024-11-05 05:06:22 字数 82 浏览 4 评论 0原文

是否可以让用户选择一个他想要发送邮件的帐户?

我可以发送邮件,但它始终来自默认帐户,我希望用户能够选择他将使用哪个帐户来发送电子邮件。

is it possible to have the user select an account from which he wants to send the mail ?

I can send a mail but it's always from the default account and i want the user to be able to select which account he will use to send the email.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫瑟鸿黎 2024-11-12 05:06:22

如果用户点击“发件人:”地址,他们可以切换帐户,此行为与普通电子邮件编辑器相同。

这是我用来启动邮件编辑器的代码:

MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];

AssetsLibraryBroker *libraryBroker = [[AssetsLibraryBroker alloc] init];
// loop through selected items;
for (NSString *fileName in [self.selectedDictionary allKeys]) {
    NSLog(@"fileName: %@", fileName);
    [controller addAttachmentData:[libraryBroker getAssetDataForFileName:fileName inManagedObjectContext:managedObjectContext]  mimeType:@"image/jpeg" fileName:[NSString stringWithFormat:@"%@.jpg", fileName]];
}

[libraryBroker release];

[self presentModalViewController:controller animated:YES];
[controller release];

我的邮件编辑器有一个可点击的“发件人:”字段。

从代码启动

If the user taps on the From: address they can switch accounts, this behavior is identical to the normal email composer.

This is the code I'm using to launch the mail composer:

MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];

AssetsLibraryBroker *libraryBroker = [[AssetsLibraryBroker alloc] init];
// loop through selected items;
for (NSString *fileName in [self.selectedDictionary allKeys]) {
    NSLog(@"fileName: %@", fileName);
    [controller addAttachmentData:[libraryBroker getAssetDataForFileName:fileName inManagedObjectContext:managedObjectContext]  mimeType:@"image/jpeg" fileName:[NSString stringWithFormat:@"%@.jpg", fileName]];
}

[libraryBroker release];

[self presentModalViewController:controller animated:YES];
[controller release];

My mail composer has a tap-able "From:" field.

Launched from Code select an account

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文