2012-11-07 92 views
1

我寻求帮助,我是新来iPhone编程IOS电子邮件应用

有没有一种方法来发送电子邮件,使用的设备配置,而无需打开撰写UI标准账户,无需Pagesheet?

我想写一个应用程序给我发送电子邮件提醒。

期待着您

感谢听到重播...

回答

0

1)是否有一种方法来发送电子邮件,使用该设备上配置标准帐户,而无需打开撰写UI

你就是不行。

备选方法:

您可以编写一个发送电子邮件到特定地址的Web服务。

1

您必须将信息发送到您管理的服务器,只是通过SMTP类型的方法发送电子邮件。

+0

我不明白你说了..?请帮助我 –

+0

@MaulikVakariya他说,只是创建web服务,并通过那里发送电子邮件。 –

+0

好的,谢谢.... –

1

您可以在发送背景电子邮件witj出利用任何作曲家窗口

this SMTPSender例如

例子:

- (BOOL)send 
{ 
    NSAssert(sendState == kSKPSMTPIdle, @"Message has already been sent!"); 

    if (requiresAuth) 
    { 
     NSAssert(login, @"auth requires login"); 
     NSAssert(pass, @"auth requires pass"); 
    } 

    NSAssert(relayHost, @"send requires relayHost"); 
    NSAssert(subject, @"send requires subject"); 
    NSAssert(fromEmail, @"send requires fromEmail"); 
    NSAssert(toEmail, @"send requires toEmail"); 
    NSAssert(parts, @"send requires parts"); 

    if (![relayPorts count]) 
    { 
     [delegate messageFailed:self 
          error:[NSError errorWithDomain:@"SKPSMTPMessageError" 
                code:kSKPSMTPErrorConnectionFailed 
               userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Unable to connect to the server.", @"server connection fail error description"),NSLocalizedDescriptionKey, 
                  NSLocalizedString(@"Try sending your message again later.", @"server generic error recovery"),NSLocalizedRecoverySuggestionErrorKey,nil]]]; 

     return NO; 
    } 

    // Grab the next relay port 
    short relayPort = [[relayPorts objectAtIndex:0] shortValue]; 

    // Pop this off the head of the queue. 
    self.relayPorts = ([relayPorts count] > 1) ? [relayPorts subarrayWithRange:NSMakeRange(1, [relayPorts count] - 1)] : [NSArray array]; 

    NSLog(@"C: Attempting to connect to server at: %@:%d", relayHost, relayPort); 

    self.connectTimer = [NSTimer scheduledTimerWithTimeInterval:connectTimeout 
                 target:self 
                 selector:@selector(connectionConnectedCheck:) 
                 userInfo:nil 
                 repeats:NO]; 

    [NSStream getStreamsToHostNamed:relayHost port:relayPort inputStream:&inputStream outputStream:&outputStream]; 
    if ((inputStream != nil) && (outputStream != nil)) 
    { 
     sendState = kSKPSMTPConnecting; 
     isSecure = NO; 

     [inputStream retain]; 
     [outputStream retain]; 

     [inputStream setDelegate:self]; 
     [outputStream setDelegate:self]; 

     [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] 
           forMode:NSRunLoopCommonModes]; 
     [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] 
           forMode:NSRunLoopCommonModes]; 
     [inputStream open]; 
     [outputStream open]; 

     self.inputString = [NSMutableString string]; 



     return YES; 
    } 
    else 
    { 
     [self.connectTimer invalidate]; 
     self.connectTimer = nil; 

     [delegate messageFailed:self 
          error:[NSError errorWithDomain:@"SKPSMTPMessageError" 
                code:kSKPSMTPErrorConnectionFailed 
               userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Unable to connect to the server.", @"server connection fail error description"),NSLocalizedDescriptionKey, 
                  NSLocalizedString(@"Try sending your message again later.", @"server generic error recovery"),NSLocalizedRecoverySuggestionErrorKey,nil]]]; 

     return NO; 
    } 
} 
相关问题