send e-mail


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: send e-mail

  1. #1
    Anthony Guest

    send e-mail


    http://www.devx.com/free/tips/tipvie...ontent_id=3685

    I have try to make the code at above link work but fail. Anyone can tell
    me how to set the host?

    Pls e-mail me. Thanks!

  2. #2
    Paul Clapham Guest

    Re: send e-mail

    That's a good question. Although the method has a String parameter named
    "host", it doesn't use that parameter anywhere. And when I run the code, I
    get the exception "java.net.UnknownHostException: mailhost", which I expect
    is what you got too. I messed about with various other ways to define the
    URL but none of them worked. It might work if your SMTP mail host happened
    to be called "mailhost"... so when the tip describes itself as "quite
    limited in its capabilities" I have to agree. And he got paid $25 for that!

    PC2

    "Anthony" <anthonykwok@writeme.com> wrote in message
    news:3bb366bb$1@news.devx.com...
    >
    > http://www.devx.com/free/tips/tipvie...ontent_id=3685
    >
    > I have try to make the code at above link work but fail. Anyone can tell
    > me how to set the host?
    >
    > Pls e-mail me. Thanks!




  3. #3
    Paul Clapham Guest

    Re: send e-mail

    After some experimentation I have found something that might work. Put this
    line of code early in the method, before you try to create the URL and so
    on:

    System.setProperty("mail.host", host);

    It still doesn't work for me because my mail host doesn't respond the way
    this code expects, but I don't get the exception any more if I use a valid
    host name.

    PC2

    "Paul Clapham" <pclapham@core-mark.com> wrote in message
    news:3bb39fab$1@news.devx.com...
    > That's a good question. Although the method has a String parameter named
    > "host", it doesn't use that parameter anywhere. And when I run the code,

    I
    > get the exception "java.net.UnknownHostException: mailhost", which I

    expect
    > is what you got too. I messed about with various other ways to define the
    > URL but none of them worked. It might work if your SMTP mail host

    happened
    > to be called "mailhost"... so when the tip describes itself as "quite
    > limited in its capabilities" I have to agree. And he got paid $25 for

    that!
    >
    > PC2
    >
    > "Anthony" <anthonykwok@writeme.com> wrote in message
    > news:3bb366bb$1@news.devx.com...
    > >
    > > http://www.devx.com/free/tips/tipvie...ontent_id=3685
    > >
    > > I have try to make the code at above link work but fail. Anyone can tell
    > > me how to set the host?
    > >
    > > Pls e-mail me. Thanks!

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center