javax.mail.SendFailedException Invalid Addresses while sending mail
<p>i had problem while sending mails useing java this is my code </p>

<pre><code>package callcentersystem;

public class Email {

    private String topic = "my test";
    private String myMassage = "nothinge";

    public void untitledMethod(String to) {
        String host = "my ip adresse";
        Properties properties = System.getProperties();
        properties.setProperty("mail.smtp.host", host);
        Session session = Session.getDefaultInstance(properties);
        try {
            MimeMessage message = new MimeMessage(session);
            message.setFrom(new InternetAddress(utils.Constants.From));
            message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
            message.setSubject(topic);
            message.setText(myMassage);
            Transport transport = session.getTransport("smtp");
            transport.send(message);
            System.out.println("Sent message successfully....");
        } catch (MessagingException mex) {
            System.out.println("the massage didnt send");
            throw new RuntimeException(mex);
        }
    }
}
</code></pre>

<p>and this is my crash massage </p>

<pre><code>the massage didnt send
Exception in thread "main" java.lang.RuntimeException:        javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 530 SMTP authentication is required.

at callcentersystem.Email.untitledMethod(Email.java:33)
at callcentersystem.CallCenterSystem.main(CallCenterSystem.java:10)
Caused by: javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 530 SMTP authentication is    required.

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1446)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:736)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send(Transport.java:120)
at callcentersystem.Email.untitledMethod(Email.java:29)
... 1 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 SMTP authentication is required.

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1344)
... 5 more
</code></pre>

<p>i tried all ways to solve this problem but it dosent work and i setup a hmailserver administrator and i use it that solved my localhost problem </p>