views:

148

answers:

1

Hello Everyone!

Can anyone help me make a EDMessage Sample Code? I don't know how to set up my headers and what the proper coding to input into my application. Here's the link if you need resources. BTW EDMessage is a framework used to send emails. EDMESSAGE. Here is the code I have so far for my headers:

#import <Cocoa/Cocoa.h>

@interface Control : NSObject {

    IBOutlet NSTextField *inputBox;
    IBOutlet NSTextField *outputBox;
    IBOutlet NSTextField *accountLabel;
    IBOutlet NSWindow *hudWindow;
    IBOutlet NSButton *checkBox;
    IBOutlet NSWindow *windowRegister;
    EDMailAgent *mailAgent;
    NSMutableDictionary *headerFields; 
    NSTask *task;
    NSPipe *pipe;
}


- (IBAction)stopButton:(NSButton *)sender;
- (IBAction)quitButton:(NSButton *)sender;
- (IBAction)sendButton:(NSButton *)sender;

@end

Sincerely,

Kevin

+1  A: 

Hope this helps:

NSMutableArray *partList = [NSMutableArray array];
EDPlainTextContentCoder *tcc1 = [[[EDPlainTextContentCoder alloc] initWithText:text] autorelease];
EDHTMLTextContentCoder *tcc2 = [[[EDHTMLTextContentCoder alloc] initWithText:text] autorelease];
EDMultimediaContentCoder *mcc = [[[EDMultimediaContentCoder alloc] initWithData:data filename:filename inlineFlag:NO] autorelease];
[partList addObject:tcc1];
[partList addObject:tcc2];
[partList addObject:mcc];


EDCompositeContentCoder *ccc = [[EDCompositeContentCoder alloc] 
   initWithSubparts:partList];
EDInternetMessage *msg = [ccc message];
[ccc release];


id headerFieldBody = [[EDTextFieldCoder encoderWithText:@"john appleseed <[email protected]>"] fieldBody];
[msg addToHeaderFields:[EDObjectPair pairWithObjects:@"From":headerFieldBody]];
[msg addToHeaderFields:[EDObjectPair pairWithObjects:@"To":headerFieldBody]];


headerFieldBody = [[EDTextFieldCoder encoderWithText:@"A Subject"] fieldBody];
[msg addToHeaderFields:[EDObjectPair pairWithObjects:@"Subject":headerFieldBody]];
catlan
okay but what about the headers?
Kevin
http://www.iu.hio.no/~mark/CTutorial/CTutorial.html#Librarieshttp://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/IncludingFrameworks.html
catlan