Email not working in ShareKit and no errors

心不动则不痛 提交于 2020-01-03 18:52:15

问题


I am using ShareKit to add Facebook, Twitter and email sharing to my iPhone app. Now, Facebook and Twitter are working but email is not. The big problem is that there is no error or anything, it is working just like it should but the email is not delivered to the recipient. This is what I am using to send the email

[SHK setRootViewController:self];
SHKItem *item;
NSURL *url = [NSURL URLWithString:@"http://www.url.com/"];
item = [SHKItem URL:url title:@"Using sharekit to share urls...."];
[SHKMail shareItem:item];

Am I doing something wrong?

EDIT: More information based on the answer by Joshua below.

  • I am testing on a simulator and do not have a device to test on right now.
  • [MFMailComposeViewController canSendMail] returns yes and i can send an email by opening safari in the simulator , then opening mail and sending email.
  • And I did not do any configuration for email. The SHKConfig.h which had the configurations did not have any options to configure email. (I added the API keys for the Twitter and Facebook and they are working as they should from the simulator)

回答1:


Just a quick couple of guesses (I haven't used ShareKit):

  1. Are you testing on the simulator or a device? Mail doesn't actually get sent from the simulator. It fakes a successful send without actually sending (that'd explain "no error").
  2. If you're testing on the device, are you sure your e-mail account is working on the device? Can you send e-mail from the regular mail client? If you have multiple accounts, the default/first should be used but test all of them.


来源:https://stackoverflow.com/questions/7905081/email-not-working-in-sharekit-and-no-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!