Quote of the Day


Quotes and sayings

Archives

Categories

  • 25Apr

    This happened to me some time ago but it can help someone else. At the time I had some troubles sending emails with SMTP and JavaMail. My code was based on the examples provided by chuidiang (The explanation in Spanish here, the Java code here). The code perfectly works with gmail (smtp.gmail.com), but not with our servers. In fact we couldn’t access the mail Server and got exceptions as:

    javax.mail.MessagingException: Could not connect to SMTP (smtp_host):(port)

    I asked to gaussmath and he gave me “a recipe” for testing whether we were seeing the mail server or not. I believe the next tips can be helpful to others.

    The basic idea to connect via telnet from our local box or the server where our application will be running to the SMTP host and execute the next tests:

    • Step-1-> Telnet (smtp_host) (port)
    • Step-2-> Helo (domain.com)
    • Step-3-> mail from: (fromMail@domain.com)
    • Step-4-> RCPT To:(toMail@domain2.com)
    • Step-5-> DATA
    • Step-6-> Test mails
    • Step-7-> .
    • Step-8-> quit

    Some other issues you should be aware are:

    1. Are you able to ping the SMTP host?
    2. Can you connect with Telnet to the SMTP host using port 25?
    3. Check firewall. Is it enabled/disabled? Is port 25 open?

    If you are working with Windows Vista and cannot execute Telnet, the reason is that Telnet is disabled by default. But you can enabled it. You can check the steps here for this.

    Tags: , , , ,

   

Recent Comments

  • brilliant!! We need more of this....
  • Yes it definitely helps, after that I saw software projects ...
  • I didnt know about the CAPM until I read your post, so do yo...