NSMailDelivery problems
NSMailDelivery problems
- Subject: NSMailDelivery problems
- From: Steve Gehrman <email@hidden>
- Date: Sat, 16 Feb 2002 18:05:06 -0800
I'm trying to use the mail delivery protocol to send emails. It works
great for english, but I can't seem to set the encoding right for
japanese.
I send c7c*c"c+c
c3cc< and receive C VC C$C AC C#C iC C,C oC[
Help! Here's my code snippet. I'm sure there must be a way of
specifying the content-type, but everything I have tried has failed.
-steve
NSString* code = [RegistrationManager
registrationCodeForEmail:[emailTextField stringValue]];
NSString* email = [emailTextField stringValue];
NSString* subject = @"SNAXc7c*c"c+c
c3cc<";
NSMutableString* message = [NSMutableString stringWithString:@"cc.e:&
c/SNAXce>!h3<e%cc&ccc c
c>cc&f i#ccccc>cco<o
<\r\rSNAXc+i"cc&c.h3*ece>!fh&ccc&
ei!g9c*c)cc
c>ccc ccc!c c>c'f%f,h*c'c!c<c+cc
&d8ccc\r\rcc!c ccc*cc.c7c*c"c+c
c3cc<
c+c*c
c>cc"];
BOOL success;
NSMutableDictionary* messageHeaders = [NSMutableDictionary
dictionary];
[message appendString:@"\r\r"];
[message appendString:email];
[message appendString:@"\r"];
[message appendString:code];
[message appendString:@"\r\r"];
[message appendString:@"--\r"];
[message appendString:@"Steve Gehrman\r"];
[message appendString:@"CocoaTech\r"];
[message appendString:@"email@hidden\r"];
[message appendString:@"
http://www.cocoatech.com\r"];
[messageHeaders setObject:@"email@hidden" forKey:@"From"];
[messageHeaders setObject:@"email@hidden" forKey:@"To"];
[messageHeaders setObject:@"Sharewarez by CocoaTech"
forKey:@"X-Mailer"];
[messageHeaders setObject:subject forKey:@"Subject"];
[messageHeaders setObject:@"charset=ISO-2022-JP"
forKey:@"Content-Type"];
success = [NSMailDelivery deliverMessage:[[[NSAttributedString
alloc] initWithString:message] autorelease] headers:messageHeaders
format:NSASCIIMailFormat protocol:nil];
if (!success)
NSBeep();
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.