Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Unknown SMTP Host

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unknown SMTP Host

    I'm up to Chapter 13 of the book, and everything has worked fine up to date.
    I am trying to get the first email example to work and I keep getting an error on the AirEmail_send(msg:recipients) line:

    DSPLY javax.mail.MessagingException: Unknown SMTP host: sm
    DSPLY TransportSend Error

    I’m a novice when it comes to networks, but managed to get some assistance from our network people who gave me the url of the SMPT server that we need to use. I was able to ping this URL from our iSeries and got the 5 out 5 responses successfully.

    I changed this line in AIR13_01 to include my email address:

    msg = AirEmail_newMessage('xxxx.xxxxxxxxxxxx@xxx.com.au'
    :'password'
    : 'exch-smtp2.xxxxx.xxxx');

    I had a look at the SVAIREMAIL code and saw that I could either pass it in or set the svDefaultHost value to the 'exch-smtp2.xxxxx.xxxx' value.
    Obviously I have crossed out the real characters.

    Is there anything obviously wrong, or are there some suggestions as to what other avenues I might be able to pursue?

    Thanks.

  • #2
    I think I worded my post incorrectly.
    I have this example working now, so am responding so that others can have a hint.

    I changed the following property setting code in SVAIREMAIL to reflect out SMTP server:

    svPropKey = new_String('mail.smtp.localhost');
    //svPropValue = new_String('mail.example.com');
    svPropValue = new_String('xxxx-xxxxx.xxxxx.corp');
    Properties_setProperty(svProp: svPropKey: svPropValue);

    It worked!

    What is really needed to use this email interface is to have a better understanding of what happens wwith SMTP and what the properties mean. Perhaps the book should include some references to material that helps in this understanding. As part of my review process, I will do this anyway.

    The beauty of Java is that there's so much code out there that's in a coherent 'shape'.
    This is the sort of book that IBM should have provided when they were trying to get the RPG world to embrace Java in the late nineties. Tom has addressed the exact issue that plagues the iSeries world when it comes to reporting, and what I have learnt from this book will result in huge time-savings.

    Comment


    • #3
      Sorry I didn't reply earlier, I was offline for a few days.

      I recently provided some training on Advanced Integrated RPG and this topic also came up. Here is a good link that provides some of the options available for the properties http://java.sun.com/products/javamai...w-summary.html Fortunately, as you've stated there are plenty of resources available for JavaMail on the Web. This information would make a good entry in the appendix of the book and I will make a point of it for future revisions.

      I greatly appreciate your input and your positive feedback! I'm glad to hear that you are enjoying and benefiting from the book!

      Thank you very much!
      Tom

      Comment

      Working...
      X