Message.framework problems!
Message.framework problems!
- Subject: Message.framework problems!
- From: Mamdouh <email@hidden>
- Date: Fri, 14 Jun 2002 00:43:34 +0200
Hi Peter...
I4m having the same problem as you, and i must say, that i4m really
really stuck! Since it seems like you figured out what your problems
solution was, i figoured you could help me!
I4m going to make this as short as possible, so heres the code i wrote:
-(void)SendMail:(id)sender{
NSMutableDictionary *headers;
NSString *ToString;
NSString *CCString;
NSString *SubjectString;
NSAttributedString *MailMessage = [[NSAttributedString alloc]
initWithString:[BodyTextView string]]; //BodyTextView: A NSTextView
ToString=[ToField stringValue]; // ToField: A NSTextField
CCString=[CCField stringValue]; //CCField: A NSTextField
SubjectString=[SubjectField stringValue]; //SubjectField: A
NSTextField
headers = [NSMutableDictionary dictionary];
[headers setObject:CCString forKey:@"CC"];
[headers setObject:ToString forKey:@"To"];
[headers setObject:SubjectString forKey:@"Subject"];
[NSMailDelivery deliverMessage:MailMessage headers:headers
format:NSASCIIMailFormat protocol:nil];
[MailMessage release];
}
The problem is that: Nothing happens here! I dont know what is wrong,
but when looking at the codem it seems like its written good enough, and
should execute some kind of action, but naothing happens, and i dont get
a worning from the compiler/runner ... I4m truly lost here, no pointers,
no warnings, no errors and stabil looking code???? What is wring here!
Could you help me?
TIA
Mamdouh
Student/Programmer
Hi,
I'm trying to get my app sending mail using Apple's message framework.
It works well when using the + (BOOL)deliverMessage:(NSString
*)messageBody subject:(NSString *)messageSubject to:(NSString
*)destinationAddress; method.
But when using the method below, I get an error: Exception raised
during message encoding: *** -[NSCFString containsAttachments]: selector
not recognized
+ (BOOL)deliverMessage: (NSAttributedString *)messageBody headers:
(NSDictionary *)messageHeaders format: (NSString *)messageFormat
protocol: (NSString *)deliveryProtocol;
Here is what I'm doing:
NSMutableDictionary *headers;
headers = [NSMutableDictionary dictionary];
[headers setObject:@"email@hidden" forKey:@"From"];
[headers setObject:@"email@hidden" forKey:@"To"];
[headers setObject:@"test" forKey:@"Subject"];
[headers setObject:@"myApp" forKey:@"X-Mailer"];
[headers setObject:@"text/plain; charset=US-ASCII; format=flowed"
forKey:@"Content-Type"];
[headers setObject:@"1.0" forKey:@"Mime-Version"];
[NSMailDelivery deliverMessage:alertMessage headers:headers
format:NSASCIIMailFormat protocol:nil];
alertMessage is an NSString.
Any ideas on what's going wrong here would be appreciated!
TIA
Peter
_______________________________________________
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.