Hi there!

I'm using scripting bridge to send emails with Mail.app and I have managed to do so, but I still have a little problem.

When adding attachments, the first one is placed at the beginning of the message, while the rest of them are placed at the end of the message, which is certainly odd. I would like to place all attachments at the end of the message, which is how I use to place them by hand, but I don't know how.

The code that adds the attachments is the following:
_______________

for ( NSString* path in [self.attachments componentsSeparatedByString: @"\n"] ) {
        
        /* add an attachment, if one was specified */
        if ( [path length] > 0 ) {
                
                /* create an attachment object */
MailAttachment *theAttachment = [[[mail classForScriptingClass:@"attachment"] alloc] initWithProperties: [NSDictionary dictionaryWithObjectsAndKeys: path, @"fileName", nil]];
                
                /* add it to the list of attachments */
                [[emailMessage.content attachments] addObject: theAttachment];
        }
}

_______________


Thanks!

Israel

_______________________________________________

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