当用户按下按钮并在文本视图中键入时,ViewController.m 将组装电子邮件的正文。读取电子邮件的程序要求它是 XML 格式的。最终消息将如下所示:
NSString *sendMessage = [[NSString alloc]initWithFormat:@"<?xml version = \"1.0\" ?>\n<?commitcrmxml version = \"1.0\" ?>\n<CommitCRMTransaction>\n<ExternalApplicationName>Myapp</ExternalApplicationName>\n<SendResponseToEmail>err@mysite.com</SendResponseToEmail>\n<Password>pass</Password>\n<ReturnTransactionID>CRDOWV34HL53J543GENDYDH92BSF</ReturnTransactionID>\n<DataKind>TICKET</DataKind>\n<RecordData>\n<FLDTKTCARDID>%@</FLDTKTCARDID>\n<FLDTKTPROBLEM>%@\n%@\n%@\n%@\n%@\n%@</FLDTKTPROBLEM>\n<FLDTKTSTATUS>100</FLDTKTSTATUS>\n<FLDTKTKIND>General</FLDTKTKIND>\n<FLDTKTPRIORITY>10</FLDTKTPRIORITY>\n<FLDTKTSOURCE>Myapp</FLDTKTSOURCE>\n<FLDTKTSCHEDLENESTIM>60</FLDTKTSCHEDLENESTIM>\n<FLDTKTFORDISPATCH>N</FLDTKTFORDISPATCH>\n</RecordData>\n</CommitCRMTransaction>", cardID, tempStoreCompany, tempStoreLocation, tempStoreName, tempStorePhone, tempStoreEmail, descriptionMessage];
我的第二个实现文件 MailSend.m 将使用 (SKP)SMTP 发送消息。MailSend.m 需要访问 sendMessage 字符串(在 ViewController.m 中)中的文本,以便可以正确发送消息。
我怎样才能做到这一点?