• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JavaMail Props Not Being Set
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaMail Props Not Being Set


  • Subject: Re: JavaMail Props Not Being Set
  • From: Alex Cone <email@hidden>
  • Date: Thu, 29 Jun 2006 10:38:15 -0400

Looks like you are using the non-WO JavaMail objects, not WOSendMail.

The properties you care about are:

	mail.smtp.host
	mail.smtp.port

Try something like:

...
public Properties proplist;
proplist = System.getProperties();
proplist.put("mail.smtp.host",
System.getProperty("SMTPHost", "smtp"));
proplist.put("mail.smtp.port",
System.getProperty("SMTPPort", "25"));
...
try {
javax.mail.Session mailSession = javax.mail.Session.getDefaultInstance(proplist,null);
Message mail = new MimeMessage(mailSession);
// set To, From, Subject, Content, etc...
Transport.send(mail);
} catch( Throwable t ) {
t.printStackTrace();
}
...


Enjoy!

Alex

On Jun 28, 2006, at 11:51 PM, email@hidden wrote:

From: Drew Thoeni <email@hidden>
Subject: Re: JavaMail Props Not Being Set
To: WebObjects Dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

So, I've tried the four suggestions:

Paul's "put in properties file": no effect.
Paul's "forgot to set properties": no effect
Mike's "wrong classpath": if I checked the right thing, that is
mail.jar and activation.jar in /Library/Java/Extensions: no effect
Henrique's "force setting of property setSMTPHost( System.getProperty
( "WOSMTPHost" ) );" no effect

Not quite true. Several had the effect of actually setting the props
(see below) but still sending mail fails with
"NoSuchProviderException". Any suggestions on more detailed debugging?

Props: {java.vendor=Apple Computer, Inc.,
WOWorkerThreadCountMax=256, <snip>
WOSMTPHost=smtp.comcast.net, <snip>
mail.smtp.host=smtp.comcast.net <snip>}

SendFailedException: javax.mail.NoSuchProviderException: smtp

regards,

Drew


___alex b cone___
    ceo  codefab  inc
    212 465-8484 x101
    email@hidden
    http://www.codefab.com

"What another would have done as well as you, do not do it. What another would have said as well as you, do not say it; written as well, do not write it. Be faithful to that which exists nowhere but in yourself --- and thus make yourself indispensable."
--André Gide (1869 - 1951) in his "Les Nourritures Terrestres. Envoi:"




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Eclipse, WO and Windows
  • Next by Date: Re: State of WebObjects
  • Previous by thread: Re: JavaMail Props Not Being Set
  • Next by thread: Tiny mce or FCKeditor.. how?
  • Index(es):
    • Date
    • Thread