gpt4 book ai didi

ios - 使用gmail api ios回复邮件

转载 作者:行者123 更新时间:2023-12-01 16:25:32 25 4
gpt4 key购买 nike

我正在尝试回复邮件的邮箱应用程序。

我浏览了文档。

 GTLQueryGmail *query = [GTLQueryGmail queryForUsersMessagesSendWithUploadParameters:nil];
query.message = gtlGmailMessage; //parent message
[self.service executeQuery:query
delegate:self
didFinishSelector:@selector(displayResult:finishedWithObject:error:)];

我需要知道在gtlGmailMessage中需要做的所有更改以回复父邮件。

提前致谢。

最佳答案

得到了解决方案。

我们必须在原始领域做所有事情。

GTLQueryGmail *query = [GTLQueryGmail queryForUsersMessagesSendWithUploadParameters:nil];
NSString *strRaw = [NSString stringWithFormat:@"To:%@\nSubject:%@\nThreadId:%@\nReply-To:%@\n\n\n%@",strToBeRep,mail.subject,mail.threadId,strToBeRep,msgToBeSend];
NSData *messageBody = [strMessageBody dataUsingEncoding:NSUTF8StringEncoding];
GTLGmailMessage *message =[[GTLGmailMessage alloc]init];
query.userId = @"me";
NSString *base64Encoded = [messageBody base64EncodedStringWithOptions:0];

message.raw = base64Encoded;

message.snippet = @"sadfasdfasd dafvasdvas dafvasdv";
base64Encoded = [base64Encoded stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
base64Encoded = [base64Encoded stringByReplacingOccurrencesOfString:@"+" withString:@"-"];
message.threadId = self.mail.mail.threadId;
query.message = message;

[self.service executeQuery:query
delegate:self
didFinishSelector:@selector(displayResultForNewMessage:finishedWithObject:error:)];


- (void)displayResultForNewMessage:(GTLServiceTicket *)ticket finishedWithObject:(GTLGmailMessage *)emailsResponse error:(NSError *)error
{
if(!error)
NSLog(@"Success");
}

关于ios - 使用gmail api ios回复邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35550140/

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