2011-08-13 12 views
0

私のiPhoneアプリケーションでSKPSMTPMessageを使用しました。複数の受信者に問題があります。私はちょうど2人の受信者に電子メールを送る必要があります。SKPSMTPMessageを使用して2人の受信者にメールを送信

私は、次のコードを使用しています:

-(void)sendEmail { 

// create soft wait overlay so the user knows whats going on in the background. 
[self createWaitOverlay]; 

//the guts of the message. 
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init]; 
testMsg.fromEmail = @"[email protected]"; 
// testMsg.toEmail = phone; 
[email protected]"[email protected]; 

testMsg.relayHost = @"smtp.nman.co.uk"; 
testMsg.requiresAuth = YES; 
testMsg.login = @"[email protected]"; 
testMsg.pass = @"nfsdxsdfswdrt"; 
testMsg.subject = @"The Confirmation"; 
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS! 

// Only do this for self-signed certs! 
// testMsg.validateSSLChain = NO; 
testMsg.delegate = self; 
} 

誰も私が2受信者

+0

はチェックこの問題:http://code.google.com/p/skpsmtpmessage/issues/detailを?id = 18&q = multiple – timbooo

+0

このコードは意味をなさない。私はすでにそれを探しました – Mann

+0

Manjinder S、私はこれのための地獄の解決策を与えて、私はそれがあなたを助けることを願っています。私の答えを見てください。 :) –

答えて

3

に電子メールを送ることができる方法を知っているこの

ためheckソリューションは、まずどのrecipientsArrayを作成してあります受信者が含まれています

NSArray* recipientsArray = [NSArray arrayWithObjects:@"[email protected]",@"[email protected]",nil]; 

その後、あなたのsendEmailメソッド定義

for(NSString* toEmailAddress in recipientsArray){ 
    [self sendEmail:toEmailAddress]; 
} 

のsendEmailメソッドを呼び出します:

-(void)sendEmail:(NSString*)_toEmailAddress { 
    // create soft wait overlay so the user knows whats going on in the background. 
    [self createWaitOverlay]; 

    //the guts of the message. 
    SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init]; 
    testMsg.fromEmail = @"[email protected]"; 

    testMsg.toEmail = _toEmailAddress; 
    testMsg.relayHost = @"smtp.nman.co.uk"; 
    testMsg.requiresAuth = YES; 
    testMsg.login = @"[email protected]"; 
    testMsg.pass = @"nfsdxsdfswdrt"; 
    testMsg.subject = @"The Confirmation"; 
    testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS! 

    // Only do this for self-signed certs! 
    // testMsg.validateSSLChain = NO; 
    testMsg.delegate = self; 
} 
+0

私は試してみましょう:-) – Mann

+0

Ok @ Manjinder S、そしてあなたの以前の問題は解決されていますか?場所1(ggogleurl? –

+0

どこで私はrecipientsArray = [@ "abc @ abc、com、@" dfa.com ""];とループ?for sendEmail:method? – Mann

関連する問題