gpt4 book ai didi

iPhone 从设置中检索应用程序中的 gmail 帐户详细信息

转载 作者:行者123 更新时间:2023-11-28 22:55:42 24 4
gpt4 key购买 nike

我正在制作一个应用程序,我想在其中使用 smtp 服务器发送电子邮件。

它工作正常,但如果用户没有提供正确的 gmail 帐户详细信息,例如(电子邮件 ID 和密码),则不会发送电子邮件。

我想做的是从 iPhone 的设置选项卡访问用户 gmail 帐户详细信息到我的应用程序吗?

是否可以将 Gmail 帐户详细信息检索到应用程序中?

请帮我解决这个问题。

以下是我的代码:

-(IBAction)sendemail
{
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
//testMsg.fromEmail = @"Lexi mobile";//nimit51parekh@gmail.com
testMsg.fromEmail = soundOn;
NSLog(@"str_Uname=%@",testMsg.fromEmail);
//str_info = [str_info stringByReplacingOccurrencesOfString:@"," withString:@""];
testMsg.toEmail = [string_emailinfo objectAtIndex:0];
NSLog(@"autoemail=%@",testMsg.toEmail);
testMsg.relayHost = @"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = soundOn;
NSLog(@"autoelogin=%@",testMsg.login);
testMsg.pass = vibrateOn;
NSLog(@"autopass=%@",testMsg.pass);
testMsg.subject = @"Photo Sharing";
testMsg.wantsSecure = YES;

NSURL *url = [[NSURL alloc]initWithString:@"http://itunes.apple.com/us/app/umix-radio/id467041430?mt=8"];
NSString *msg2 = [NSString stringWithFormat:@"<html><b><a href=\"%@\">DOWNLOAD NOW</a></b>&nbsp&nbsp<a href=\"http://itunes.apple.com/us/app/umix-radio/id467041430?mt=8\"></a></html>",url];
NSString *sendmsg=[[NSString alloc]initWithFormat:@"%@",msg2];
NSLog(@"automsg=%@",sendmsg);

testMsg.delegate = self;

NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey,
sendmsg,kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];

testMsg.parts = [NSArray arrayWithObjects:plainPart,nil];
[testMsg send];

// [self DeleteRowAfterSending];
//[self performSelector:@selector(DeleteRowAfterSending) withObject:nil afterDelay:5.0];
}

-(void)messageSent:(SKPSMTPMessage *)message
{
[message release];

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"Your email is sent successfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];

NSLog(@"delegate - message sent");
}

-(void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error
{
[message release];

// open an alert with just an OK button
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Fail" message:@"Message sending failure" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];

NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]);
}

最佳答案

What i want to do is i want to access user gamil account details from setting tab of the iPhone into my app? is it possible to do retrive the gamil account detail into the app?

不,有充分的理由:该功能将允许任何开发人员访问任何人的电子邮件帐户

那将是一个巨大的安全漏洞。

与位置服务非常相似,您只需要求用户输入他们的电子邮件地址和密码即可。并希望他们愿意使用此类个人信息来信任您的应用程序。 (假设 Apple 完全批准了您的应用。)

关于iPhone 从设置中检索应用程序中的 gmail 帐户详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10845894/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com