Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

email blasting...

Okay so I have been trying to write an email blaster for the Mac. I have made some progress, but I am stuck with getting it to hide (bcc) other recipients. Here is what I have so far… what am I missing?

- (IBAction)sendEmailMessage:(id)sender 
{

/* create a Scripting Bridge object for talking to the Mail application */

MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"];
    
/* set ourself as the delegate to receive any errors */

mail.delegate = self;
	
/* create a new outgoing message object */
	
MailOutgoingMessage *emailMessage = [[[mail classForScriptingClass:@"outgoing message"] alloc] initWithProperties:

[NSDictionary dictionaryWithObjectsAndKeys:
[subjectField stringValue], @"subject",
[[messageContent textStorage] string], 
@"content", nil]];
				
/* add the object to the mail app  */

[[mail outgoingMessages] addObject: emailMessage];

/* set the sender, show the message */

emailMessage.visible = YES;
    
/* Test for errors */
    
if ( [mail lastError] != nil )
        return;
				
		
/* create a new recipient and add it to the recipients list */
	
MailBccRecipient *theRecipient = [[[mail classForScriptingClass:@"to recipient"] alloc] initWithProperties:
                                        
[NSDictionary dictionaryWithObjectsAndKeys:
                                            
[toField string], @"address", nil]];
	
[emailMessage.bccRecipients addObject: theRecipient];

Sign In or Register to comment.