Hi Humayun

You can look at this for ideas:

http://www.javacommerce.com/articles/SendMailUsingAuthentication.java

Soren


-----Oprindelig meddelelse-----
Fra: S M Humayun [mailto:[EMAIL PROTECTED] 
Sendt: 17. januar 2004 13:48
Til: Tomcat Users List
Emne: Re: SV: Tomcat config

Thanks Soren,
 
The example is very helpful, but what if my smtp server asks me to pass
my username and password also ? 
 
thanks again,
 
Humayun.

S�ren_Blidorf <[EMAIL PROTECTED]> wrote:
I don't know if this is what you mean, but this jsp page sends mails
with javaMail.

BR

Soren


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]


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