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

ERJavaMail erroneously returns component


  • Subject: ERJavaMail erroneously returns component
  • From: Drew Thoeni <email@hidden>
  • Date: Tue, 1 Aug 2006 06:50:31 -0400

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERJavaMail erroneously returns component
      • From: Fabian Peters <email@hidden>
  • Next by Date: Re: ERJavaMail erroneously returns component
  • Next by thread: Re: ERJavaMail erroneously returns component
  • Index(es):
    • Date
    • Thread