
也许有一些我忽略,简化这个。
谢谢。
解决方法 MessageFramework on CocoaDev列出了各种可能性,“Sending emails from Cocoa”也列出了几个框架,包括Pantomime,MailCore和EdMessage(site for this似乎是下来,但有一个mirror on github,也被修改为编译为10.4,以及10.5 – 所以应该在iPhone上工作)
使用Pantomime的示例代码(来自上述博客):
CWMessage *message = [[CWMessage alloc] init];CWInternetAddress *address;address = [[CWInternetAddress alloc] initWithString:@"from@gmail.com"];[message setFrom:address];[address release];address = [[CWInternetAddress alloc] initWithString:@"to@somewhere.com"];[address setType:PantomimetoRecipIEnt];[message addRecipIEnt:address];[address release];[message setSubject:@"test"];[message setContentType: @"text/plain"];[message setContentTransferEnCoding: PantomimeEnCodingNone];[message setCharset: @"us-ascii"];[message setContent: [@"This is a simple content." dataUsingEnCoding: NSASCIIStringEnCoding]];smtp = [[CWSMTP alloc] initWithname:@"smtp.gmail.com" port:465];[smtp setDelegate: self];[smtp setMessage: message];[message release];ssl = YES;mechanism = @"PLAIN";[smtp connectInBackgroundAndNotify];总结
以上是内存溢出为你收集整理的iphone – 开源Cocoa/Cocoa-Touch POP3/SMTP库?全部内容,希望文章能够帮你解决iphone – 开源Cocoa/Cocoa-Touch POP3/SMTP库?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)