Hi. I have just installed the Exim MTA on Debian 5. After installation I have tested it by typing in shell :
echo "This is a test." | mail -s Testing
someone@somedomain.com
, where
someone@somedomain.com is my mail.
And it was successful sending of email, to specified address.
However, when I try to send an email from my application, because my application does that, I try to specify my smtp server as 'localhost' in my code, using java mail, like this :
Code:
properties = new Properties( );
properties.put("mail.host", 'localhost');
session = Session.getInstance(properties, null);
..etc...
When I do so I get an exception :
Code:
javax.mail.MessagingException: 501 Syntactically invalid HELO argument(s)
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1634)
at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:1070)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:458)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
...more stack here
However, I try to specify mail server as a 'mail.quarksystems.eu', where quarksystems.eu is my domain, I got a following error :
Code:
javax.mail.MessagingException: Could not connect to SMTP host: quarksystems.eu, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1545)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
...more...
So, how can I find out, what is the name of my server, in order to send a mail, or where to configure it, or do I event need to specify that property?
Thanks in advance