The mail servlet is now working again. I had to add some code (although still funny
thing because it worked before, without changes). If interested I can mail you the new
code
-----Urspr�ngliche Nachricht-----
Von: Christopher S. Fox [mailto:[EMAIL PROTECTED]]
Gesendet am: Samstag, 12. Februar 2000 22:51
An: [EMAIL PROTECTED]
Betreff: Re: Mailservlet just stopped working?
<< Datei: Card for Christopher S. Fox >> I noticed the same thing with the
SmtpClient can no longer resolve
code has not changed and no longer works
conicidence?
or my local mail provider problem?
looking for alternative at this point
"Czichos, Marc" wrote:
> Hi,
> we use a Java servlet to collect information from a webpage and send the
content via email to an emailaccount. The mailing part is based on the
sun.net.smtp.SmtpClient class. After a Java version upgrade (1.2) on our webserver the
mailing doesn't work anymore. I read somewhere, that the sun.net.Smtp class is "not
offically supported" and subject to change.
> The servlet compiles without any error messages.
> Any idea?
>
> Here's the code:
>
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.lang.reflect.*;
> import java.net.*;
> import java.lang.*;
> import sun.net.smtp.SmtpClient;
>
> public class FanshopServlet extends HttpServlet
> {
>
> public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
> {
> res.setContentType("text/plain");
> PrintWriter out = res.getWriter();
>
> String to = "[EMAIL PROTECTED]";
> String from = "FanshopServlet";
>
> String anzTshirtM = req.getParameter("T-Shirt-M");
> String mail = req.getParameter("mailTo");
>
> try {SmtpClient smtp = new SmtpClient();
> smtp.from(from);
> smtp.to(to);
> PrintStream msg = smtp.startMessage();
> msg.println("To: " + to);
> msg.println("Subject: Fanshop Bestellung");
> msg.println();
> msg.println("T-Shirt-M : " + anzTshirtM);
> msg.println("Sent by " + HttpUtils.getRequestURL(req));
> smtp.closeServer();
>
>
res.sendRedirect("http://www.xx.de/shop/gcfanstuff_repost_i.htm");}
>
> catch (IOException e) {out.println("<HTML><body text=#AAAAAA
bgcolor=#000000>");
> out.println("xxx");
> out.println("</BODY></HTML>");
> getServletContext().log(e, "There was a problem sending
email");}
> }
> }
>
> Thanx,
>
> Marc
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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