私のアプリケーションでは、複数の受信者に電子メールを送信したいと考えています。一度に 1 人にメールを送信できますが、複数の受信者にメールを送信したいと考えています。
私は受信者のデータを含む nsmutable 配列 *sNamesArr を持っています。NSMutableArray *sNamesArr;
以下はmコードです:
-(void)sendEMAIL
{
NSLog(@"Paused state100");
[dictUser retain];
//Auto code
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
//testMsg.fromEmail = @"Lexi mobile";//nimit51parekh@gmail.com
testMsg.fromEmail = str_uname;
NSLog(@"str_Uname=%@",testMsg.fromEmail);
// str_info = [str_info stringByReplacingOccurrencesOfString:@"," withString:@""];
// testMsg.toEmail = str_info;
// NSLog(@"autoemail=%@",testMsg.toEmail);
//str_info = [str_info stringByReplacingOccurrencesOfString:@"," withString:@""];
testMsg.toEmail = str_info;
NSLog(@"autoemail=%@",testMsg.toEmail);
testMsg.relayHost = @"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = str_uname;
NSLog(@"autoelogin=%@",testMsg.login);
testMsg.pass = str_password;
NSLog(@"autopass=%@",testMsg.pass);
testMsg.subject = @"Schedule Sms And Email";
testMsg.wantsSecure = YES;
NSString *sendmsg=[[NSString alloc]initWithFormat:@"%@",str_info2];
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];
}