Tim Leist wrote:
>
> Gary,
> A look at the source reveals the sun.net.smtp.SmtpClient
> class doesn't support a Cc or Bcc methiod, although it wouldn't
> be too hard to extend the class to include the methods yourself.
Actually, at this level there's no such thing as a real Cc or Bcc.
As I understand it (haven't read the docs in forever), at the SMTP
level you connect to the server and say who you want the mail sent to.
Things like a To address, Cc address, and all are just headers in the
message. The transport layer doesn't care about them. Bcc-ing someone
is just sending them a mail without putting a To or Cc header listing
them. Cc-ing someone is just sending a mail with them listed on the Cc
line.
That's how this mailing list works, after all. This mail made it to
you, but you're not listed in any headers. They simply set the To:
header to be the mailing list address.
So to use SmtpClient for this, just send multiple emails (since it
doesn't support more than one actual recipient address -- bummer)
but use the same headers each time to reflect the To/Cc/Bcc you're
trying to convey.
And yes, you can use this knowledge to mail your sweetheart an overly
explicit love note that includes a Cc: their mother, while keeping the
Cc: totally fake. Just be careful. A Reply All uses the headers (real
or not) to determine where to send the reply!
-jh-
P.S. Yes, you officially shouldn't use sun.* classes, but when the
class is easy to use, is installed everywhere there's a JDK, and hasn't
changed since JDK 1.0, it's hard to resist. Esp when the alternative
is the overly complex JavaMail API.
--
Jason Hunter
[EMAIL PROTECTED]
Book: http://www.servlets.com/book
Article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
___________________________________________________________________________
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