Does the sendmail program use SMTP (presumably it does, because it wouldn't
be very useful otherwise)? If so, use the JavaMail API:
import javax.mail.*;
import javax.mail.internet.*;
import java.util.Properties;
String mailhost = ...;
String from = ...;
String to = ...;
String subject = ...;
String msgText = ...;
Properties props = new Properties();
props.put("mail.host", mailhost);
javax.mail.Session mailConnection =
javax.mail.Session.getInstance(props, null);
Message msg = new MimeMessage(mailConnection);
msg.setContent(msgText, "text/plain");
msg.setFrom(new InternetAddress(from));
msg.setRecipient(new InternetAddress(to));
msg.setSubject(MimeUtility.encodeText(subject));
Transport.send(msg);
Two files, mail.jar and activation.jar, need to be pathed in for this code
to work. If this isn't suitable for you, I've written some code which you
can use to talk to the SMTP server directly and will let you have if you get
in touch directly.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]