I don't know if this is what you mean, but this jsp page sends mails
with javaMail.

BR

Soren


<%@ page import="javax.mail.*, javax.mail.event.*,
javax.mail.internet.*, java.util.*, java.lang.String" %>

<%

Properties props = new Properties();
props.put("mail.smtp.host", "YOUR SMTP");
Session s = Session.getInstance(props);

MimeMessage message = new MimeMessage(s);

String mail;

mail = request.getParameter("mail");
InternetAddress from = new InternetAddress(mail);
message.setFrom(from);
InternetAddress to = new InternetAddress("[EMAIL PROTECTED] ");
message.addRecipient(Message.RecipientType.TO, to);

message.setSubject(request.getParameter("subject"));
message.setText("Mail from "+request.getParameter("name")+"
"+request.getParameter("text"));

Transport transport = s.getTransport("smtp");

transport.connect();
transport.send(message);
transport.close();

%>

-----Oprindelig meddelelse-----
Fra: S M Humayun [mailto:[EMAIL PROTECTED] 
Sendt: 17. januar 2004 13:34
Til: [EMAIL PROTECTED]
Emne: Tomcat config

Hi all,
 
Can some one please tell me how to make my JSP's use JavaMail to send
emails from my domain, say www.abc.com ? please mention step by step
process which files to edit and where to edit ? I have a private JVM
account therefore I am viewing complete Tomcat directory. 
 
Thanks in advance,
 
Humayun.


Syed Muhammad Humayun
Web Developer
Al Ghanem Net LLC



---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to