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 18:16:01 -0700
Still didn't work. I ended up with a 'From::' header that had the right
address, and a 'From:' header that had the system default address. All of
my email clients are honoring the one I don't want.
Thanks,
Chris
on 6/4/02 5:42 PM, Steve Dossick said:
>
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.
_______________________________________________
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.
References: | |
| >Re: (From: "Steve Dossick" <email@hidden>) |