NIRANJAN RAILKAR

Greenhorn
+ Follow
since Mar 26, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by NIRANJAN RAILKAR

Hi
As there is Addrotator component in Asp is there any facility in jsp, if not what can be done?
21 years ago
i have develop a shopping cart in jsp, i have a class which have to be called from jsp file, i am using tomcat server
please tell me where to place this class files so that it can be accessed in from jsp file
Thanx
Niranjan
21 years ago
I Have Written code for sending mail through servlet
from yahoo account
I am getting the following error
"No provider for pop3".
I Have activated my yahoo account also
still i am getting this error
please help
//code
import java.util.*;
import java.io.*;
import java.text.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SendMailServlet extends HttpServlet
{

public static String MAIL_HOST = "smtp.mail.yahoo.com";
public static String MAIL_HOST2 = "pop.mail.yahoo.com";
/**
* <p>Performs the HTTP POST operation
*
* @param req The request from the client
* @param resp The response from the servlet
*/
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
{
resp.setHeader("Pragma", "No-cache");
resp.setDateHeader("Expires", 0);
resp.setHeader("Cache-Control", "no-cache");
// Set the content type of the response
resp.setContentType("text/html");
// Create a PrintWriter to write the response
java.io.PrintWriter out = new java.io.PrintWriter (resp.getOutputStream());
// Get the data from the form
String from = req.getParameter("MAIL_FROM");
String subject = req.getParameter("MAIL_SUBJECT");
String body = req.getParameter("MAIL_BODY");
String to = req.getParameter("MAIL_TO");
// create some properties and get the default Session
Properties props = new Properties();
props.put("mail.smtp.host", MAIL_HOST);
Session sess = Session.getDefaultInstance(props, null);
try {
// Connect to host
Store store = sess.getStore("pop3");
store.connect(MAIL_HOST2, -1, "my-username", "my-password");
// Create a message
Message msg = new MimeMessage(sess);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setContent(body, "text/html; charset=ISO-8859- 1");//HTML type
//msg.setContent(body); //Text type
// Send the message
Transport trans = sess.getTransport("smtp");
trans.connect(MAIL_HOST,"my-username","my-password");
trans.send(msg);
// Let the user know that the mail was sent
out.println("<html>");
out.println("<head>");
out.println("<title>Send Email</title>");
out.println("<body><center>");
out.println("<h2>Your email has been sent!</h2>");
out.println("</center></body></html>");
trans.close();
}
catch (Exception ex) {
// Got an error sending the mail; notify the client
out.println("<html>");
out.println("<head>");
out.println("<title>Send Email Error</title>");
out.println("<body><center>");
out.println("<h2>There was an error sending your email</h2>");
out.println("<br>Message=" + ex.getMessage());
out.println("</center>");
out.println("</body></html>");
}
// Wrap up
out.flush();
}
/**
* <p>Initialize the servlet. This is called once when the
* servlet is loaded. It is guaranteed to complete before any
* requests are made to the servlet
*
* @param cfg Servlet configuration information
*/
public void init(ServletConfig cfg)
throws ServletException
{
super.init(cfg);
}
/**
* <p>Destroy the servlet. This is called once when the servlet
* is unloaded.
*/
public void destroy()
{
super.destroy();
}
}
21 years ago
Thanx for your reply
creating .bat File works
Thankx again
Niranjan
21 years ago
how top create .exe file in java i have to start applet by just doubleclicking an icon is this possible ?
please help me out
thanks
niranjan
21 years ago