• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: sending mail using message framework
      • From: Chris DeSalvo <email@hidden>
  • Prev by Date: CFURLRef -> NSFileManager path
  • Next by Date: RE: CFURLRef -> NSFileManager path
  • Previous by thread: Re: CFURLRef -> NSFileManager path
  • Next by thread: Re: sending mail using message framework
  • Index(es):
    • Date
    • Thread