Re: sending email
Re: sending email
- Subject: Re: sending email
- From: "Peter Sichel" <email@hidden>
- Date: Wed, 14 May 2003 11:11:29 -0400
>
>> I am needing to send an email (a text buffer with a header) to port 25
>
>> of a given IP and would like to ask the list what would be the
>
>> smartest
>
>> approach using C/C++ with Carbon mach-o on 10.2. I am mostly looking
>
>> for simplicity and reliability.
>
>>
>
>> Thank's in advance.
>
>>
>
>> Best regards
>
>>
>
>> Patrick Perroud
>
>
>
> Consider using the Message.framework hidden in
>
> /System/Library/Frameworks.
>
>
>
>
Is it possible to use it from a Carbon Mach-O app ?
I'm not sure what the rules are for calling an objective-C
framework from a Carbon application. The framework itself
works nicely from Cocoa as illustrated below.
- Peter
// ----------------------------------------------------------------------
// 7 sendEmail
// ----------------------------------------------------------------------
// send current log text as email if enabled
- (void)sendEmail
{
NSString* str;
do {
if ([preferences integerForKey:kPreferences_mailEnable]) {
if (![NSMailDelivery hasDeliveryClassBeenConfigured]) {
NSLog(@"EventLogger: Mail delivery class has not been configured");
break;
}
str = [preferences objectForKey:kPreferences_mailName];
if (!str) {
NSLog(@"EventLogger: mail to address has not been configured");
break;
}
[NSMailDelivery deliverMessage:[mText string]
subject:@"--- IPNetSentry Security Log ---"
to:str];
}
} while (false);
}
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.