• 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: How does one call Application.setSMTPHost from the client side?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does one call Application.setSMTPHost from the client side?


  • Subject: Re: How does one call Application.setSMTPHost from the client side?
  • From: "B. Shank" <email@hidden>
  • Date: Fri, 30 May 2003 12:05:31 -0700

On Friday, May 30, 2003, at 11:56 AM, Scott Ellsworth wrote:

> This should be simple.
>
> I want to set the SMTP server from a client side FormController.  I
> can see how to do this if there were a way to set it from the server
> side Session object, or if there were a way to get at the server side
> Application object from the client side FormController.  Sessions, as
> best as I can tell, do not have access to the Application, and client
> side form controllers do not have access to it either.  (Unless I
> missed something.)

Try: public static WOApplication application ()

Brent

>
> Why do I want this: I was working with the Admissions tutorial, and
> wanted to set the appropriate SMTP server via a database call at
> runtime.  Calling Application.setSMTPHost in the Application
> constructor works fine, but I want to simulate different user profiles
> with different SMTP servers and the like.
>
> Here is the code from my client side custom form controller:
>
> 	public void sendRecordViaEmail() {
> 		SelectServer smtpServer=new SelectServer(username);
> 		String smtpServerName = smtpServer.selectSMTPServer();
>
> 		//_distributedObjectStore().invokeRemoteMethodWithKeyPath(new
> EOEditingContext(), "application", "clientSideRequestSetSmtpServer",
> new Class[] {String.class}, new Object[] { smtpServerName}, true);
>
> 		SelectEmail emailAddresses=new SelectEmail();
> 		NSArray emailAddressIDs = emailAddresses.selectEmailAddresses();
>
> 		_distributedObjectStore().invokeRemoteMethodWithKeyPath(new
> EOEditingContext(), "session", "clientSideRequestSendRecordViaEmail",
> new Class[] {EOEnterpriseObject.class, NSArray.class}, new Object[] {
> selectedObject(), emailAddressIDs}, true);
> 	}
>
> SelectServer successfully reads the appropriate SMTP server for the
> username, but calling invokeRemoteMethodWithKeyPath on the application
> object as the commented out code above does results in an access > error.
>
> I can move the method to the server's session object, but it does not
> have access to the Application object, and it is in the Application
> object that the setSMTPHost call lives.
>
> What am I missing?
>
> Scott
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How does one call Application.setSMTPHost from the client side?
      • From: Scott Ellsworth <email@hidden>
References: 
 >How does one call Application.setSMTPHost from the client side? (From: Scott Ellsworth <email@hidden>)

  • Prev by Date: How does one call Application.setSMTPHost from the client side?
  • Next by Date: Re: From OpenBase To MSSQLServer2000 (built app)
  • Previous by thread: How does one call Application.setSMTPHost from the client side?
  • Next by thread: Re: How does one call Application.setSMTPHost from the client side?
  • Index(es):
    • Date
    • Thread