- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我花了两天时间来实现这个,但没有成功。我正在使用 http://code.google.com/p/skpsmtpmessage/source/checkout 中的 SMTPSender 项目代码...演示项目完美运行!但是当我将类文件复制到我的项目时(如说明所示),它可以正常构建并运行。但是当我尝试发送电子邮件时......它给出了以下错误。
C: Attempting to connect to server at: smtp.gmail.com:25
2011-04-21 17:42:29.183 LocaliphoneAppRequest[5517:207] C: Attempting to connect to server at: smtp.gmail.com:465
2011-04-21 17:42:37.183 LocaliphoneAppRequest[5517:207] C: Attempting to connect to server at: smtp.gmail.com:587
2011-04-21 17:42:37.546 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.549 LocaliphoneAppRequest[5517:207] S: 220 mx.google.com ESMTP l5sm941912wej.32
2011-04-21 17:42:37.553 LocaliphoneAppRequest[5517:207] C: EHLO localhost
2011-04-21 17:42:37.557 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:37.741 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.742 LocaliphoneAppRequest[5517:207] S: 250-mx.google.com at your service, [119.153.117.81]
2011-04-21 17:42:37.743 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.744 LocaliphoneAppRequest[5517:207] S: 250-SIZE 35882577
2011-04-21 17:42:37.745 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.747 LocaliphoneAppRequest[5517:207] S: 250-8BITMIME
2011-04-21 17:42:37.748 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.749 LocaliphoneAppRequest[5517:207] S: 250-STARTTLS
2011-04-21 17:42:37.754 LocaliphoneAppRequest[5517:207] C: STARTTLS
2011-04-21 17:42:37.755 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:37.756 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.759 LocaliphoneAppRequest[5517:207] S: 250 ENHANCEDSTATUSCODES
2011-04-21 17:42:37.937 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:37.939 LocaliphoneAppRequest[5517:207] S: 220 2.0.0 Ready to start TLS
2011-04-21 17:42:37.942 LocaliphoneAppRequest[5517:207] Beginning TLSv1...
2011-04-21 17:42:37.944 LocaliphoneAppRequest[5517:207] C: EHLO localhost
2011-04-21 17:42:38.675 LocaliphoneAppRequest[5517:207] *** starting short watchdog ***
2011-04-21 17:42:38.861 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.861 LocaliphoneAppRequest[5517:207] S: 250-mx.google.com at your service, [119.153.117.81]
2011-04-21 17:42:38.863 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.864 LocaliphoneAppRequest[5517:207] S: 250-SIZE 35882577
2011-04-21 17:42:38.867 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.869 LocaliphoneAppRequest[5517:207] S: 250-8BITMIME
2011-04-21 17:42:38.872 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.874 LocaliphoneAppRequest[5517:207] S: 250-AUTH LOGIN PLAIN XOAUTH
2011-04-21 17:42:38.875 LocaliphoneAppRequest[5517:207] *** stopping watchdog ***
2011-04-21 17:42:38.879 LocaliphoneAppRequest[5517:207] S: 250 ENHANCEDSTATUSCODES
2011-04-21 17:42:38.880 LocaliphoneAppRequest[5517:207] -[NSConcreteMutableData encodeBase64ForData]: unrecognized selector sent to instance 0x6a67190
2011-04-21 17:42:38.914 LocaliphoneAppRequest[5517:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableData encodeBase64ForData]: unrecognized selector sent to instance 0x6a67190'
我的代码是
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = @"mygmail@gmail.com";
testMsg.toEmail = @"myanothergmail@gmail.com";
testMsg.relayHost = @"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = @"mygmail@gmail.com";
testMsg.pass = @"mypass";
testMsg.subject = @"test message";
// testMsg.bccEmail = @"testbcc@test.com";
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
// Only do this for self-signed certs!
// testMsg.validateSSLChain = NO;
testMsg.delegate = self;
NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey,
@"This is a test message.",kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
testMsg.parts = [NSArray arrayWithObjects:plainPart,nil];
[testMsg send];
请帮帮我......:(
最佳答案
当我第一次开始使用 SKPSMTPMessage 时,我遇到了这个问题。我忘记了细节或从哪里得到原始答案,但我将 NSStream+SKPSMTPExtensions.* 包装到 SKPSMTPMessage.* 中,然后它就消失了。
只需将接口(interface)和实现放在导入之后、NSStream (SKPSMTPExtensions) 的其余代码之前。
关于iphone - 使用 SMTPSender/SKPSMTPMessage 发送电子邮件给出错误 -[NSConcreteMutableDataencodeBase64ForData] : unrecognized selector sent to instance 0x6a67190,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5744335/
我正在使用 SKPSMTPMessage 发送电子邮件。它在模拟器中运行良好,但当我在 iPad 上尝试时,它发送邮件但之后崩溃。我的中继主机是 testMsg.relayHost = @"smtp
我正在尝试合并此 bit of code进入一个新的(iOS 5)项目......问题是,我正在使用 ARC,它真的不喜欢所写的代码。 我已经能够解决大多数错误,但是我遇到了 3 个我似乎无法弄清楚的
我需要发送一个可变字符串作为消息。我正在使用 SKTPSMTPMesaage 将食品订单从我的应用程序发送到面包店。帮助?这是我的代码: NSDictionary *plainPart = [NSDi
所以我对这门课有一个严重的问题...... 目前,当用户实际发送电子邮件时,ActivityIndicator 显示...太棒了!!!而且 UI 没有被卡住...太酷了! 问题是,如果用户推送到另
我在我的项目中使用 SkpsmtpMessage 库,一切正常。问题在于电子邮件正文的布局。我想以漂亮的布局显示它,例如粗体名称,然后想将图像嵌入其中,以便在客户端打开电子邮件等时显示。现在我正在使用
我一直在尝试使用 SKPSMTPMessage对于我正在创建的 iOS 应用程序。该应用程序现在确实会发送电子邮件,但似乎在某些客户端上的电子邮件查看方面存在一些问题。 例如,我可以在 Gmail 上
我需要在后台发送电子邮件,所以我必须使用名为:SMTP 的库。而我使用的主要类是:SKPSMTPMessage。问题是“ccEmail”,当我添加超过 2 个收件人时,它无法发送电子邮件。 (去委托(
我已经测试了使用这个有用的库发送附件的代码: Skpsmtpmessage library 电子邮件似乎已正确发送,当我通过 hotmail 或 gmail 客户端查看它时,我看到了 jpeg 图像。
是否有任何 SKPSMTPMessage 库可以在 Swift 中使用? earlier i have used this tutorial which is in objective - c .我想
我正在尝试使用 skpsmtpmessage 发送邮件.但收件人将看到 SMTP 授权用户 ID。 “fromEmail”变量在这种情况下是无用的。如何使用另一个邮件 ID 发送邮件。我也无法更改发件
我正在尝试将邮件从 iPhone 发送到任何邮件,我使用了 SKPSMTPMessage,它在所有类型的模拟器中都能正常工作(iPhone/iPad 4.3、iPhone/iPad 5.1、iPhon
我花了两天时间来实现这个,但没有成功。我正在使用 http://code.google.com/p/skpsmtpmessage/source/checkout 中的 SMTPSender 项目代码.
我是一名优秀的程序员,十分优秀!