Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: Java Authentication Problem


Message #1 by "Carlos Arias" <carlos.arias5@v...> on Wed, 12 Feb 2003 08:01:48
Call the hosting company and find out if they even gave you permissions
to send mail. Sometimes they have you set up weird when your doing the
right thing all along! I hate that.

-Wiley


-----Original Message-----
From: Carlos Arias [mailto:carlos.arias5@v...] 
Sent: Wednesday, February 12, 2003 8:02 AM
To: Servlets
Subject: [servlets] Java Authentication Problem

Hi, the hosting company my website is parked is JavaServletHosting.Com 
 i'm trying to create an e-mail application in JSP, when i try to send
the 
mail it gives me an error saying Authentication needed 554. 
  i looked around to see if there is any forums or sites i can learn
from 
but there isn't anything that can help me. This is my code. 


 ----------------------------------------------------------------------
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
  Properties props = new Properties();
  props.put("mail.smtp.host", "mail.hosting.com");
  Properties s_props = System.getProperties();
  s_props.put("mail.smtp.auth", "true"); // for sending to external
 
  Session s = Session.getInstance(props,null);
 
  MimeMessage message = new MimeMessage(s);
  InternetAddress from = new InternetAddress(webmaster@w...);
  message.setFrom(from);
  InternetAddress to = new InternetAddress("domain@d...");
  message.addRecipient(Message.RecipientType.TO, to);
 
 //---------------HTML coding in to e-mail starts here -----------//
String htmlmessage = "<html><body><b><center><h4>Testing Authentication 
</h4></center></b><br>\n";
htmlmessage += "<DIV><FONT size=2><FONT color=#ff0000><FONT 
color=#000000>\n";
 
  message.setSubject("Subject Goes Here ");
  message.setContent(htmlmessage, "text/html;charset=\"iso-8859-1\"");
  Transport.send(message);
%>
<html>
<p align="center">Thank You For Writing To Me.</p>
<form name="form1" method="post" action="mail.jsp">
</form>
</html>
------------------------------------------------------------------------
--


how can i make the application send the username and password to the
SMTP 
server? 
   is there a book or any type of source i can read up on to help me
with 
this problem.
   I e-mailed my Hosting company they said that they can't disable the 
authentication. 
  what is it that i am missing? 

Thank you for you help
-Carlos 


  Return to Index