Re:
Re:
- Subject: Re:
- From: "Steve Dossick" <email@hidden>
- Date: Tue, 4 Jun 2002 17:42:31 -0700
You probably also want to add a 'From:' header (note the colon) in addition
to the 'From' header. Otherwise sendmail will add the From: as the name of
the logged-in user.
-s
----- Original Message -----
>
Date: Tue, 11 Jun 2002 14:30:41 -0700
>
Subject: Re: sending mail using message framework
>
From: Chris DeSalvo <email@hidden>
>
To: <email@hidden>
>
>
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.