dcsimg
Please Help !!!Trouble to authentications
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Id_Hag
Posted On:   Tuesday, April 30, 2002 03:56 PM

Hi !!, I have the 505 problem, do you know what is wrong?. Error: Exception in thread "main" javax.mail.MessagingException: 505 Client was not authenticated at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:507) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:312) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:168) at HelloMail.main(HelloMail.java:39) Code: import java.util.Properties; import javax.mail.*; import javax.mail.internet.*; public class HelloMail { public static void main(String args[]) throws Exception { String host="mail.x   More>>

Hi !!, I have the 505 problem, do you know what is wrong?.

Error:

			
Exception in thread "main" javax.mail.MessagingException: 505 Client was not authenticated
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:507)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:312)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:168)
at HelloMail.main(HelloMail.java:39)




Code:


			

import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;

public class HelloMail {
public static void main(String args[]) throws Exception {
String host="mail.xxx.com.mx"; //
String from="evalua@xxx.com.mx"; //sender's email
String to ="harriaga@xxx.com.mx" ; //receiver's email

Properties props = System.getProperties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");

// NEW //
ServerAuthenticate myauth = new ServerAuthenticate("harriaga@xxx.com.mx", passw);
Session session = Session.getInstance(props, myauth);

MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new
InternetAddress(to));
message.setSubject(" My Test HTML email ");
message.setText(" Here is the content ");
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect("mail.xxx.com.mx","harriaga@xxx.com.mx",passw);
transport.sendMessage(message,message.getAllRecipients());
transport.close();
}
}
   <<Less

Re: Please Help !!!Trouble to authentications

Posted By:   John_Zukowski  
Posted On:   Wednesday, May 1, 2002 08:48 AM

Authentication is already shown in the FAQ.

What is ServerAuthenticate?

Perhaps you just need to use harriaga, not the complete email address.
About | Sitemap | Contact