And don't forget to put the required classes or jar files in the
NETDYN_CLASSPATH not just the regular classpath.

Brendan
Team NetDynamics





Curt Springer <[EMAIL PROTECTED]> on 08/27/99 08:57:03 AM

To:   "Rimma" <[EMAIL PROTECTED]>
cc:   [EMAIL PROTECTED] (bcc:
      Brendan Johnston/Contractor/CF/CCI)
Subject:  Re: [ND] Using the Sun Java E-mail class with ND




'just do it'

At the same point where you have vanilla (i.e. non-ND dependent) java code
to access the file system, substitute vanilla java code to open a
connection to an email server and send a message.

-- Curt Springer, Team ND

At 06:12 AM 8/27/99 -0700, Rimma wrote:

>Hello my forum pals,
>In my application, I'm generating an HTML file.  And as it loads into the
>browser, it's also
>supposed to be sent automatically the the user via e-mail.  I was told on
>the forum that
>I can use the new Sun Java e-mail class which I downloaded from the Sun's
>web site.
>However, I don't know how to use it with my ND app.  Do you have any
>suggestions?
>I'm pasting the code from the OnBeforeHTMLOutput event for the page and
>I'm attaching
>the page itself, in case it will be helpful.
>Thanks,
>Rimma
>
>//[[SPIDER_EVENT<this_onBeforeHtmlOutputEvent>
>         public int this_onBeforeHtmlOutputEvent(CSpHtmlOutputEvent event)
>         {
>                 try
>                 {
>                         CSpStringOutputStream _origStream =
> CSpider.getOutputStream ();
>                         ByteArrayOutputStream _myArrayStream = new
> ByteArrayOutputStream (20000);
>                         CSpStringOutputStream _myStream = new
> CSpStringOutputStream (_myArrayStream);
>
>                         // Flush everything so that our byte array will
> get loaded
>                         // with the HTML
>                         CSpHtml.flush (_myStream);
>
>                         // Convert the byteArray into a String
>                         String   htmlPage = _myArrayStream.toString ();
>
>                         // Modify HTML for file output
>                         String modifiedHtmlPage =
> CSpUtil.replaceSubstring (htmlPage, "<IMG src=\"/images/dailyne2.gif\"
>         width=\"129\" height=\"45\" border=\"0\" align=\"middle\">",
> "<Font size=+3><b>Daily
>         News</b></font>");
>                         modifiedHtmlPage = CSpUtil.replaceSubstring
> (modifiedHtmlPage, "<IMG src=\"/images/archive.gif\" border=\"0\"
> width=\"77\" height=\"28\">", "");
>                         modifiedHtmlPage = CSpUtil.replaceSubstring
> (modifiedHtmlPage, "<IMG src=\"/images/date.gif\" border=\"0\"
> width=\"40\" height=\"28\">", "");
>
>                         // Create file and store modified HTML init
>                         String fileName = "C:\\temp\\"+
> CSpider.getUserSessionObject("sesDate").toString() + ".html";
>//CSpHtml.write ("File Name: " + fileName);
>                         FileOutputStream newsFile = new
> FileOutputStream(fileName);
>                         newsFile.write (modifiedHtmlPage.getBytes());
>                         newsFile.close();
>
>                         // Restore the original output stream
>                         //CSpider.setOutputStream (_origStream);
>
>                         // Write the modified HTML out
>                         CSpHtml.sendRawDataItem (_origStream, htmlPage);
>                 }
>                 catch (Exception ex)
>                 {
>                         CSpHtml.sendMessage ("Search result: " + ex);
>                 }
>                 return (PROCEED);
>         }
>         //]]SPIDER_EVENT<this_onBeforeHtmlOutputEvent>

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]




_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to