2011-12-11 32 views
1

我需要发送一个变量字符串作为消息。我正在使用SKTPSMTPMesaage从我的应用程序向面包店发送食品订单。帮帮我?这里是我的代码:如何发送SKPSMTPMessage中的变量字符串

NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey, 

          @"string goes here",kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];  

回答

1
NSDictionary *plainPart = 
     [NSDictionary dictionaryWithObjectsAndKeys: 
@"text/plain", 
kSKPSMTPPartContentTypeKey, 
[NSString stringWithFormat:@"string goes here%@",yourVaraibleName], 
kSKPSMTPPartMessageKey,@"8bit", 
kSKPSMTPPartContentTransferEncodingKey,nil]; 

通知的stringWithFormat调用。您可以通过删除文本'string goes here'(忽略引号)来完全替换您的变量字符串。

+0

我的荣幸先生! – webby

相关问题