问题
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):
- 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").
- 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