[英]Iphone to send email to multiple recipients using smtp server?
In my application i want to send email to multiple recipients. 在我的应用程序中,我想向多个收件人发送电子邮件。 i am able to send email to one person at a time and now i want to send email to multiple recipients.
我能够一次向一个人发送电子邮件,现在我想向多个收件人发送电子邮件。
i am having a nsmutable array *sNamesArr which content the data of the recipient. 我有一个nsmutable数组* sNamesArr,内容满足接收者的数据。 NSMutableArray *sNamesArr;
NSMutableArray * sNamesArr;
following is m code: 以下是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];
}
It appears that the SKPSMTPMessage class is limited to sending to a single address at a time. 看来,SKPSMTPMessage类仅限于一次发送到单个地址。 So it seems that you have three choices:
因此,您似乎有三个选择:
SKPSMTPMessage sends to the SMTP address all at once, and must send one by one. SKPSMTPMessage一次全部发送到SMTP地址,并且必须一次发送一次。
This link would be really helpful for you. 该链接对您真的很有帮助。
Send email to multiple recipients with SKPSMTPMessage? 使用SKPSMTPMessage向多个收件人发送电子邮件吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.