Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Sending a JSP page by email


Message #1 by "N.S.VISHWANATHA NADIG" <nadigvishwa@h...> on Wed, 11 Apr 2001 18:20:25 -0000
Dear Sir/Mdm,
 I have a big problem that i am creating webmail with the help of pop mail
protocol
and I could see the whole mail by writing some servlet code but I am not able to
open
account in my pop mail server by program I want to know how can I open account
in my
pop mail server by java related program.
I will be greatful to u.
With worm regards
vikram mishra ( vikram@b... )



Roy Ngan wrote:

> Sorry, i miss you some important points in my previous reply.
>
> the code in my previous mail is a Jsp code, before you can use it, you need
> to download 2 APIs from Sun JAVA, which is Javamail and Java Activation
> Framework.
>
> after you unzip the 2 APIs, you need to include 2 .jar file in your
> classpath, the 2 .jar file is mail.jar (from javamail) and activation.jar
> (from Java Activation Framework).
>
> you need to import 3 classes in the beginning of the page (which I miss out
> in the previous reply), there are
> <%@ page import=" javax.mail.*, javax.activation.*,java.util.*" %>
>
> you can always refer to the URL for full and complete tutorial of how to use
> javamail
>
> http://www.jspinsider.com/tutorials/jsp/javamail/JSPJavaMail_intro.html
>
> Regards,
> Roy Ngan,
> Next Synthesis Sdn. Bhd.
> Web Developer
>
> ----- Original Message -----
> From: "lingling lee" <linglinglee@h...>
> To: "Pro_JavaServer_Pages" <pro_jsp@p...>
> Sent: Friday, April 13, 2001 3:43 PM
> Subject: [pro_jsp] Re: Sending a JSP page by email
>
> > Is this a scriplet? how do you use it?
> > I used it like a scriplet, it doesn't work...
> > ----Original Message Follows----
> > From: "Roy Ngan" <kkngan@n...>
> > Reply-To: "Pro_JavaServer_Pages" <pro_jsp@p...>
> > To: "Pro_JavaServer_Pages" <pro_jsp@p...>
> > Subject: [pro_jsp] Re: Sending a JSP page by email
> > Date: Fri, 13 Apr 2001 13:10:35 +0800
> >
> >    // compose and send email
> >    String EmailSubject = "YOUR_Email_Subject";
> >    String EmailContent = null;
> >    EmailContent  = "<html><head><title>Page Title</title></head><body
> > bgcolor=\"#FFFFFF\">";
> >    EmailContent  = EmailContent + "<font face="arial" size="2">
> > Your_HTML_CODE_HERE";
> >    EmailContent  = EmailContent + "</font></body></html>";
> >
> >     try{
> >      Properties props = new Properties();
> >      Session sendMailSession;
> >      Store store;
> >      Transport transport;
> >
> >     sendMailSession = Session.getInstance(props, null);
> >     props.put("mail.smtp.host", "YOUR_SMTP_SERVER");
> >
> >      Message newMessage = new MimeMessage(sendMailSession);
> >      newMessage.setFrom(new InternetAddress("SOURCE_ADDRESS"));
> >      newMessage.setRecipient(Message.RecipientType.TO, new
> > InternetAddress("DESTINATION_ADDRESS"));
> >      newMessage.setSubject(EmailSubject);
> >      newMessage.setSentDate(new java.util.Date());
> >      // send the mail in HTML format
> >      newMessage.setContent(EmailContent , "text/html");
> >      transport = sendMailSession.getTransport("smtp");
> >      transport.send(newMessage);
> >      }
> >     catch(MessagingException m) {
> >      out.println(m.toString());
> >      }
> >
> > ----- Original Message -----
> > From: "N.S.VISHWANATHA NADIG" <nadigvishwa@h...>
> > To: "Pro_JavaServer_Pages" <pro_jsp@p...>
> > Sent: Thursday, April 12, 2001 2:20 AM
> > Subject: [pro_jsp] Sending a JSP page by email
> >
> >
> >  > Hi Gurus,
> >  >
> >  > How to send entire jsp page through mail(ie html output).
> >  > With java mail , Presently Iam sending URL link as a mail.
> >  > But you know this is not good for security reasons. I want to send
> >  > entire page(html output of jsp) . please help me.
> >  > Thanx& regards
> >  > vishwanatha
> >  >
> 

  Return to Index