Baris

> Do u know source for sending mail?

Have you tried using the mailto protocol with the URL
and URLConnection class?  There is an example in
Flanagan's Java Tutorial By Example (in the Nutshell
series); the code goes something like:

import java.net.*;
import java.util.*;
import java.io.*;

public class mailtoDemo {

  public static void main(String[] args) {
    PrintWriter pw = null;
    try {
      URL mailTo = new URL( "mailto:[EMAIL PROTECTED]" );

      URLConnection cMailTo = mailTo.openConnection();
      cMailTo.setDoInput( false );
      cMailTo.setDoOutput( true );
      cMailTo.connect();

      pw = new PrintWriter( new OutputStreamWriter(
cMailTo.getOutputStream() ) );

      pw.println( "From: [EMAIL PROTECTED]"  );
      pw.println( "To: [EMAIL PROTECTED]" );
      pw.println( "Subject: Test Email" );
      pw.println( "Remember to change the email
addresses before trying this" );
      pw.println( "Also on NT Machines set up a
MailHost ip address in the hosts file" );


    } catch( Exception ex ) { ex.printStackTrace(); }
    if ( null != pw )
      pw.close();
  }
}

Hope this helps

Stuart Butler
===
Stuart Butler
Entier Ltd
[EMAIL PROTECTED] or [EMAIL PROTECTED]
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to