Библиотека Cocoa/Cocoa-Touch POP3/SMTP С открытым исходным кодом?

Другой способ - удалить файл. Загрузите файл с помощью класса FileStream и выпустите файл через stream.Dispose (); он никогда не даст вам исключение «Процесс не может получить доступ к файлу», потому что он используется другим процессом. »

using (FileStream stream = new FileStream("test.jpg", FileMode.Open, FileAccess.Read))
{
    pictureBox1.Image = Image.FromStream(stream);
     stream.Dispose();
}

 // delete your file.

 File.Delete(delpath);
25
задан Coocoo4Cocoa 11 April 2009 в 22:54
поделиться

3 ответа

MessageFramework on CocoaDev lists various possibilities,

"Sending emails from Cocoa" also lists several frameworks, including Pantomime, MailCore and EdMessage (the site for this seems to be down, but there is a mirror on github, which has also been modified to compile for 10.4, as well as 10.5 - so should work on the iPhone)

Example code using Pantomime (from the above blog-post):

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];
31
ответ дан 28 November 2019 в 21:23
поделиться

Вот один из них. Я сам не пробовал, но вы можете попробовать ...

http://code.google.com/p/skpsmtpmessage/

6
ответ дан keremk 15 October 2019 в 16:43
поделиться

Вы также можете взглянуть на фреймворки с открытым исходным кодом OmniGroup , в частности фреймворк OmniNetworking. В их других фреймворках также есть много других замечательных компонентов, которые вы могли бы рассмотреть.

1
ответ дан 28 November 2019 в 21:23
поделиться