Hey all,

My problem is that using this process, the first email
is fine, the second emailworks but the is NO SUBJECT.
But I use the same code.

I have a servlet that uses SMTP to email.  From
ServletA.methodB I get the needed strings and then
call ServletC.methodD() to do the email.  I have 2
email address so this is done like twice in a row from
ServletA.methodB().  (Some code left out for
readability.)

ServletA.methodB() {
    ServletC.methodD(subject,from,to1,msg,smtpHost);
    ServletC.methodD(subject,from,to2,msg,smtpHost);
}

FYI: ServletB   import sun.net.smtp.SmtpClient;
ServletB.sendEmail(subject,from,to,msg,smtpHost) {
   SmtpClient smtp = new SmtpClient(smtpHost);
   smtp.from(from);
   smtp.to(to);
   PrintStream ps = smtp.startMessage();
   ps.println('\n' + "Subject:" + subject);
   ps.println(msg);
   smtp.closeServer();
   ps.close();

The fist email goes and is perfect.
The second email goes and is correct EXCEPT that there
is NO SUBJECT!

Has anyone ever experienced this?  Any suggestions?

Thanks for any help,

Dave Updike
Greenbrier & Russel, Inc. - Dallas, TX

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

___________________________________________________________________________
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