首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用SKPSMTPMessage的iPhone应用程序崩溃

使用SKPSMTPMessage的iPhone应用程序崩溃
EN

Stack Overflow用户
提问于 2012-09-11 18:07:50
回答 2查看 1K关注 0票数 4

我正在使用SKPSMTPMessage发送电子邮件。它在模拟器中工作得很好,但当我在iPad上尝试时,它会发送邮件,但之后它会崩溃。我的中继主机是

代码语言:javascript
复制
 testMsg.relayHost = @"smtp.gmail.com"

问题出在哪里??有人能帮我吗?

提前感谢

编辑:错误:

代码语言:javascript
复制
 2012-09-11 16:10:02.824[2902:707] C: Attempting to connect to server at: smtp.gmail.com:25
 2012-09-11 16:10:03.368 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:03.370 [2902:707] S: 220 mx.google.com ESMTP iq3sm9573874pbc.5
 2012-09-11 16:10:03.371 [2902:707] C: EHLO localhost

 2012-09-11 16:10:03.373 [2902:707] *** starting short watchdog ***
 2012-09-11 16:10:03.475 [2902:707] 0
 2012-09-11 16:10:03.476 [2902:707] 0
 2012-09-11 16:10:03.522 [2902:707] 0
 2012-09-11 16:10:03.854 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:03.855 [2902:707] S: 250-mx.google.com at your service, [112.196.5.2]
 2012-09-11 16:10:03.856 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:03.857 [2902:707] S: 250-SIZE 35882577
 2012-09-11 16:10:03.858 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:03.858 [2902:707] S: 250-8BITMIME
 2012-09-11 16:10:03.859 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:03.861 [2902:707] S: 250-STARTTLS
 2012-09-11 16:10:03.862 [2902:707] C: STARTTLS

 2012-09-11 16:10:03.863 [2902:707] *** starting short watchdog ***
 2012-09-11 16:10:03.864 [2902:707] *** stopping watchdog ***
 2 012-09-11 16:10:03.865 [2902:707] S: 250 ENHANCEDSTATUSCODES
 2012-09-11 16:10:04.108 [2902:707] *** stopping watchdog ***
 2012-09-11 16:10:04.110 [2902:707] S: 220 2.0.0 Ready to start TLS
 2012-09-11 16:10:04.112 [2902:707] Beginning TLSv1...
 2012-09-11 16:10:04.113 [2902:707] C: EHLO localhost

 2012-09-11 16:10:05.088 [2902:707] *** starting short watchdog ***
  2012-09-11 16:10:05.332 [2902:707] *** stopping watchdog ***
  2012-09-11 16:10:05.334 [2902:707] S: 250-mx.google.com at your service, [112.196.5.2]
 2012-09-11 16:10:05.335 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:05.336 [2902:707] S: 250-SIZE 35882577
2012-09-11 16:10:05.337 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:05.337 [2902:707] S: 250-8BITMIME
2012-09-11 16:10:05.338 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:05.339 [2902:707] S: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
2012-09-11 16:10:05.340 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:05.340 [2902:707] S: 250 ENHANCEDSTATUSCODES
2012-09-11 16:10:05.341 [2902:707] C: AUTH PLAIN AGJyZWFraW4ucmVwb3J0QGdtYWlsLmNvbQBicmVha2luLnJlcG9ydA==

2012-09-11 16:10:05.342 [2902:707] *** starting short watchdog ***
2012-09-11 16:10:06.074 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:06.075 [2902:707] S: 235 2.7.0 Accepted
2012-09-11 16:10:06.077 [2902:707] C: MAIL FROM:<xyz@gmail.com> BODY=8BITMIME

2012-09-11 16:10:06.078 [2902:707] *** starting short watchdog ***
2012-09-11 16:10:06.321 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:06.323 [2902:707] S: 250 2.1.0 OK iq3sm9573874pbc.5
2012-09-11 16:10:06.324 [2902:707] C: RCPT TO:<abc@com>

2012-09-11 16:10:06.326 [2902:707] *** starting short watchdog ***
2012-09-11 16:10:06.566 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:06.568 [2902:707] S: 250 2.1.5 OK iq3sm9573874pbc.5
2012-09-11 16:10:06.569 [2902:707] C: DATA

2012-09-11 16:10:06.570 [2902:707] *** starting short watchdog ***
2012-09-11 16:10:07.644 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:07.646 [2902:707] S: 354  Go ahead iq3sm9573874pbc.5
2012-09-11 16:10:07.656 [2902:707] *** starting long watchdog ***
2012-09-11 16:10:12.645 [2902:707] *** stopping watchdog ***
2012-09-11 16:10:12.647 [2902:707] *** stopping watchdog ***
(lldb) 

这里self.watchdogTimer = nil;EXC_BAD_ACCESS

EN

回答 2

Stack Overflow用户

发布于 2012-09-11 18:32:28

您是否将附件与电子邮件一起发送?如果是,则必须使用相关的MIME类型。

票数 0
EN

Stack Overflow用户

发布于 2014-11-23 15:42:42

两年后,我也遇到了这个问题。可能对某些人会有用我的解决方案:

代码语言:javascript
复制
@implementation SMTPEmailManager
{
    SKPSMTPMessage* _smtpMessage;
}

- (void) sendMessage
{
    ...
    _smtpMessage = [[SKPSMTPMessage alloc] init];
    _smtpMessage.relayHost = @"smtp.gmail.com";
    ...

    [_smtpMessage send];
}

- (void) messageSent: (SKPSMTPMessage*) message
{
    _smtpMessage = nil;
    ...    
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12367356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档