participate


Sun Java Studio Creator - Sending EMail doesn't work
<<   Back to Forum  |   Give us Feedback
This topic has 5 replies on 1 page.
alexandreafc
Posts:3
Registered: 8/24/05
Sending EMail doesn't work   
Jul 1, 2004 6:21 AM

 
Hi, when I try to send a e-mail a error message appear, because my e-mail server need do log in/ validate, how can I validate in my smtp mail server??? Anyone knows???

Message Error:
ERROR SENDING E-MAIL: sun.net.smtp.SmtpProtocolException: 553 UTILIZE A AUTENTICACAO PARA ENVIO DE MENSAGENS/THIS SERVER IS TO BE USED WITH AUTHENTICATION (#5.7.1)
 
DrinkHotJavaCoffee
Posts:116
Registered: 1/24/03
Re: Sending EMail doesn't work   
Jul 1, 2004 6:07 PM (reply 1 of 5)  (In reply to original post )

 
"THIS SERVER IS TO BE USED WITH AUTHENTICATION"
This implies that you did not specify a username/password.

In the code snippet that is provided by JSC, there is a place for you to fill these items in. Did you do so?

Regards,
- D.t.O
 
Tosa_Developer
Posts:141
Registered: 12/10/04
Re: Sending EMail doesn't work   
Mar 15, 2005 9:15 PM (reply 2 of 5)  (In reply to #1 )

 
The code snipped provided by JSC states that it will not work if your mail server requires validation:

// Send Email
// This clip can be used in a button action
// method to send an e-mail via SMTP
// (if no authentication is required from the mailserver)
//TODO: Create a Text Area component on the page and 
// a Button, place this code in the Button's action method 
//TODO: set the from, to addresses and the mail server
String from = "From address"; // from address 
String to = "To address"; // to address 
String mailserver = "SMTP mail server name"; 
// please note that if your mail server requires authentication,
// this code may not work
try { 
   sun.net.smtp.SmtpClient client = new sun.net.smtp.SmtpClient( mailserver ); 
   client.from(from); 
   client.to(to); 
   java.io.PrintStream message = client.startMessage(); 
   message.println("To: " + to); 
   // TODO: set the subject line 
   message.println("Subject: Customer Comments"); 
   // TODO: set the body of the message 
   message.println(getTextArea1().getValue().toString()); 
   client.closeServer(); 
} catch (java.io.IOException ex) { 
   // in the case of an exception, print a message to the output log 
   log("ERROR SENDING EMAIL:"+ex); 
}
 
winpe
Posts:13
Registered: 1/24/06
Re: Sending EMail doesn't work   
Jun 22, 2006 1:35 AM (reply 3 of 5)  (In reply to #2 )

 
I have three follow up questions on this thread.

1. If it requires authentication, how do you specify that?
2. I tried the email tutorial and it works without authentication. I would like to know what decides whether you need to get authenticated or not. If I did not have authentication code in my code, how can mail server accept my message. I am a bit surprised that it works. ;)
3. For email, do you need to apply similar concept like database connection pooling? If does, how do you do that?
 
mw46
Posts:397
Registered: 6/1/04
Re: Sending EMail doesn't work   
Jun 23, 2006 9:47 AM (reply 4 of 5)  (In reply to #3 )

 
I have three follow up questions on this thread.

1. If it requires authentication, how do you specify
that?

I think you will have to rework the code a bit to use javax.mail.* I found
http://www.javacommerce.com/destination65673/18274/SendMailUsingAuthentication.java
as an example.


2. I tried the email tutorial and it works without
authentication. I would like to know what decides
whether you need to get authenticated or not. If I
did not have authentication code in my code, how can
mail server accept my message. I am a bit surprised
that it works. ;)

The receiving server decides what it will accept for transport. It can do it based on DNS, authentication or whatever. Open relays (SMTP servers which accept emails from everywhere to forward) are considered bad these days.


3. For email, do you need to apply similar concept
like database connection pooling? If does, how do you
do that?

I don't know.

Thanks,
-- Marco
 
AlpeshJK
Posts:7
Registered: 11/2/06
Re: Sending EMail doesn't work   
Dec 19, 2007 9:12 AM (reply 5 of 5)  (In reply to original post )

 
I have developed an Excel VBA Application which sends mails to any number of recipients even from any email addresses without verifying with the password!

But, thats an Excel VBA Application, i dont think it would be of your interest.
 
This topic has 5 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 22
  • Guests : 132

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums