Sending email using Pantomime
Sending email using Pantomime
- Subject: Sending email using Pantomime
- From: Thierry Bucco <email@hidden>
- Date: Fri, 9 Apr 2004 12:37:47 -0400
Hi,
I would like to send email using pantomime frameworks, but i am
experiencing a problem.
Here is my code :
ToRecipient *toAddress = [[ToRecipient alloc]
initWithString:@"email@hidden"];
InternetAddress *fromAddress = [[InternetAddress alloc]
initWithString:@"email@hidden"];
Message *messageObj = [[Message alloc] init];
SMTP *smtpObj = [[SMTP alloc] initWithName:@"smtp.server.com" port:25];
//[smtpObj authenticateWithUsername:@"thierry" password:nil
mechanism:nil];
NSString *emailContents = [NSString stringWithString:@"hello world"];
[messageObj setContentType:@"TEXT/PLAIN"];
[messageObj setCharset:@"CHARSET=utf-8"];
[messageObj addToRecipients:toAddress];
[messageObj setFrom:@"CurrenciesConverter"];
[messageObj setSubject:@"CurrenciesConverter"];
[messageObj setContentFromRawSource:[emailContents
dataUsingEncoding:NSUTF8StringEncoding]];
[smtpObj sendMessage:messageObj]; // <<-- problem here
[smtpObj release];
[toAddress release];
[messageObj release];
But it doens't work I get this error :
At the line : [smtpObj sendMessage:messageObj];
2004-04-09 12:36:24.787 CurrenciesConverter[2567] *** -[NSCFString
dataValue]: selector not recognized
2004-04-09 12:36:24.787 CurrenciesConverter[2567] An uncaught exception
was raised
2004-04-09 12:36:24.787 CurrenciesConverter[2567] *** -[NSCFString
dataValue]: selector not recognized
2004-04-09 12:36:24.788 CurrenciesConverter[2567] *** Uncaught
exception: <NSInvalidArgumentException> *** -[NSCFString dataValue]:
selector not recognized
Do you have an idea ?
thierry
_______________________________________________
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.