Re: sending mail using message framework
Re: sending mail using message framework
- Subject: Re: sending mail using message framework
- From: Chris DeSalvo <email@hidden>
- Date: Tue, 11 Jun 2002 14:30:41 -0700
on 6/6/02 1:44 PM, John Anderson said:
>
The selector expects an NSAttributedString as its first parameter, not an
>
NSString.
>
>
Perhaps try this instead:
>
>
NSMutableDictionary *headers;
>
NSAttributedString *attrAlertMessage = [[NSAttributedString alloc]
>
initWithString:alertMessage];
>
headers = [NSMutableDictionary dictionary];
>
[headers setObject:@"email@hidden" forKey:@"From"];
>
[headers setObject:@"email@hidden" forKey:@"To"];
>
[headers setObject:@"test" forKey:@"Subject"];
>
[headers setObject:@"myApp" forKey:@"X-Mailer"];
>
[headers setObject:@"text/plain; charset=US-ASCII; format=flowed"
>
forKey:@"Content-Type"];
>
[headers setObject:@"1.0" forKey:@"Mime-Version"];
>
[NSMailDelivery deliverMessage:attrAlertMessage headers:headers
>
format:NSASCIIMailFormat protocol:nil];
>
[attrAlertMessage release];
The above code work great, except that the From address of the mail is
always set to the default mail address set in system preferences.
Anyone know how to actually change the from address? Would I be naove to
ask about the existence of documentation other than the header file?
Thanx,
Chris
_______________________________________________
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.