tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Blidorf <so...@nolas.dk>
Subject SV: Tomcat config
Date Sat, 17 Jan 2004 12:39:57 GMT
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("info@abc.com ");
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:humayun_reports@yahoo.com] 
Sendt: 17. januar 2004 13:34
Til: tomcat-user@jakarta.apache.org
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message