-
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!
-
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!
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks