• 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: ERJavaMail erroneously returns component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERJavaMail erroneously returns component


  • Subject: Re: ERJavaMail erroneously returns component
  • From: Fabian Peters <email@hidden>
  • Date: Tue, 1 Aug 2006 15:49:45 +0200

Hi Drew,

see <http://en.wikibooks.org/wiki/Programming:WebObjects/ Project_WONDER/Frameworks/ERJavaMail#Gotchas>

cheers

Fabian

Am 01.08.2006 um 12:50 schrieb Drew Thoeni:

I'm successfully using ERJavaMail to send HTML components. However, each time this method gets run, the user is returned the HTML component page that is emailed. Instead, I would like the user to remain on the page from which the email was sent (there's a submit button on that page that send the email).

Does anyone know why the EMailPage would be returned and, more important, how to stop that behavior?

Regards,

Drew


public void sendEmail() {
// Create an instance of an ERMailDelivery subclass
ERMailDeliveryHTML mail = new ERMailDeliveryHTML();

// set all needed fields
String fromAddress = reportEntryItem.employeeassignedto ().secondaryEmail();
<snip> removed code for setting other fields </snip>


// ERMailDeliveryHTML needs a WOComponent to render the HTML text content.
session.setReportEntryItemToEmail( reportEntryItem );
EMailPage pageToEmail = ( EMailPage )pageWithName( "EMailPage" );
mail.setComponent( pageToEmail );

// Here you create a new instance of the message
// You can loop over this fragment of code, not forgetting to use newMail(),
// before you set the attributes of the message.
try {
mail.newMail();
mail.setFromAddress ( fromAddress, fromName ); // Strings
mail.setSubject ( subject );
mail.setToAddress ( toAddress , toName ); // Strings
mail.setBCCAddresses ( bccAddresses ); // NSArray


mail.sendMail();
}
catch (Exception e) {
System.out.println( "Email exception: " + e ); //replace with NSLog
}
}


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40e-lumo.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: ERJavaMail erroneously returns component
      • From: shaun <email@hidden>
References: 
 >ERJavaMail erroneously returns component (From: Drew Thoeni <email@hidden>)

  • Prev by Date: ERJavaMail erroneously returns component
  • Next by Date: Re: ERJavaMail erroneously returns component
  • Previous by thread: ERJavaMail erroneously returns component
  • Next by thread: Re: ERJavaMail erroneously returns component
  • Index(es):
    • Date
    • Thread