On 23 Sep 2009, at 04:37, jon wrote:

great, found it, Thank you..... do you (or someone) know how to get the current machine's default Email address for sending email?

rather than typing it into a field like this.

emailMessage.sender = [self.fromField stringValue];

Try the AddressBook frame work. The following gets the logged in user email address.

ABMultiValue* emailAddresses = [[[ABAddressBook sharedAddressBook] me] valueForProperty: kABEmailProperty];
if( emailAddresses )
{
        NSString*               defaultKey = [emailAddresses primaryIdentifier];
        if( defaultKey )
        {
unsigned int defaultIndex = [emailAddresses indexForIdentifier: defaultKey];
                if( defaultIndex >= 0 )
                        emailAddr = [emailAddresses valueAtIndex: defaultIndex];
        }
}

thanks again,
Jon.

On Sep 22, 2009, at 8:35 PM, Nick Zitzmann wrote:


On Sep 22, 2009, at 8:16 PM, jon wrote:

it works fine, but I want to go ahead and have it automatically send the email, rather than display the email on screen (ready to send)...

Can someone point me in the correct direction?

Use NSAppleScript or the scripting bridge. There's some sample code on ADC that will show you how to use the scripting bridge to send a message.

Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com

Jonathan Mitchell

Developer
http://www.mugginsoft.com





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to