Hi,
>From Carlos message I understand that the addres for smtp server is set
as a system property called "mail.host", and to ensure it is set
correctly, you will better call
System.getProperties.put("mail.host" , itsAddress);
The itsAddress string variable is your servlet's responsability to fill
during init()...
Don't know what property is needed for the port to be used, but
hopefully "smtp" port should be OK in most cases.
Bye,
Cezar.
P.S. - someone asked where GSP is - search at http://www.bitmechanic.com
It includes the smtp classes.
Its advantages vs. "mailto:.." URLs are, at first glance:
- They dont use directly sun.stuff.packages, wich everybody tell
not to rely on.
Strange, cos com.bitmechanic.smtp is non-standard to,
but.. you can rely on.
- Have the sources..
- Messages are qeued in a sepparate thread, so the sendMessage() returns
quicly.
On Thu, 17 Jun 1999, Formanek Gary L wrote:
> I think some of the problem may be in not seeing all your code. Here's what
> I don't understand:
>
> If this is SMTP, where is the hostname and port?
>
> This appears to be incomplete to me.
>
> I understand the message portion as that's the same as I do with Sockets,
> but I have different setup I do for Sockets. Is this all you do to set it
> up?
>
> Since you are using an URL, you may not need these, but I have never seen it
> done this way. I use a Socket from a servlet with a class. It is different,
> not in the message, but the communication to the host and set up.
>
> Thanks,
>
> Gary
>
> > -----Original Message-----
> > From: Carlos Amengual [SMTP:[EMAIL PROTECTED]]
> > Sent: Thursday, June 17, 1999 9:39 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Sending emails
> >
> > Gary, I'm sometimes not a good "enlightener", however here you have an
> > attempt to explain:
> >
> > The original class represents an email message and has a method that
> > opens a mailto URL and send what is given by the toString() function.
> > The toString() simply returns the e-mail message in RFC822 format.
> >
> > You have the following variables:
> >
> > to_address : the address you want to send to
> > from_address: the from address
> > subject: the subject
> > body: the body of the message
> >
> > I don't think it's so difficult. Probably weird, but not difficult.
> > Could you explain what you don't understand ?
> >
> > I forgot to mention that it is a good idea that you do not assume the
> > system to be properly configured, and set (from some configuration
> > setting at initargs) the SMTP mail host:
> >
> > System.getProperties().put("mail.host", your_mailhost_here);
> >
> > HTH,
> >
> > Carlos
> >
> >
> > Formanek Gary L wrote:
> > >
> > > Maybe you can enlighten me, but I don't see how this actually sends an
> > > email?
> > >
> > > Thanks,
> > >
> > > Gary
> >
> > __________________________________________________________________________
> > _
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html