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
begin:vcard
n:Fox;Christopher
tel;cell:(917) 673-5414
tel;fax:(212) 863-9734
tel;work:(212) 863-9362
x-mozilla-html:FALSE
url:http://www.trudat.com/fox/resume.htm
org:trudat.com;internet
version:2.1
email;internet:[EMAIL PROTECTED]
title:El Presidente
adr;quoted-printable:;;71 Broadway=0D=0ASuite 16K;New York;NY;10006-2610;USA
x-mozilla-cpt:;20112
fn:Christopher S. Fox
end:vcard