How Do I correctly make settings Using JavaMail

I am using Hudson build tool for making builds . Hudson is an opensource for making ears and jars using ant apache Targets. Now I am enabling this build Tool for Email notification .

For email notification I have 3 columns or propeties to set

These are 1. SMTP Server
2. Admin Email Address
3 SMTP port  

Once these settings are done then need to specify to whom the email is to be sent ?

Please help in this regard . I am using the JavaMail API ..and our organisation is  using Microsoft Exchange Server 2007 for email address . I have setup new address in Microsoft Exhange Server. Can I use this email address in above java based Hudson Tool (JavaMailAPI)

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Never used Hudson but if they use Javamail API, it is a straight forward SMTP

You should be able to use the mail addresses (just make sure that the exchange will accept the mails sent from this other domain).

Try and then if something fails, post the errors/stacktrace/whatever you have and we will work from there
ashish_gautamAuthor Commented:
Thanks for the Quick Response . Surely I will share the Erros/stacktrace tomorrow (as today is holiday)

But how do I ensure that Exchange will accept mails from my Java Mail Setup .. Since this is an Organisation mails Setup there must be firewalls and security restriction. How would I cope with them ??
You talk to your email admins and they sort it out for you. There is no way for you to do anything if you do not have access.

Alternatively, they can provide you access to a relay somewhere in the organisation which then sends to the Exchange -- but even then it is up to your admins to allow access.

Javamail is just an API. It tries to send a mail but it cannot bypass any security settings or make a server allow a mail they would not (by default a server should not be accepting mails sent from unknown server - so someone would need to allow your mails to go through)
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

ashish_gautamAuthor Commented:
hi Venabili and Experts Team

I used the organisation Email address and SMTP server as Microsoft Exchange but the following error came Could some guidance be provided

com.sun.mail.smtp.SMTPSendFailedException: 550 Invalid recipient: < my company email address> at com.sun.mail.smtp.SMTPTransport.issueSendCommand( at com.sun.mail.smtp.SMTPTransport.finishData( at com.sun.mail.smtp.SMTPTransport.sendMessage( at javax.mail.Transport.send0( at javax.mail.Transport.send( at hudson.tasks.MailSender.execute( at hudson.tasks.Mailer.perform( at hudson.tasks.BuildStepMonitor$1.perform( at hudson.model.AbstractBuild$AbstractRunner.perform( at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep( at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep( at hudson.model.Build$RunnerImpl.post2( at hudson.model.AbstractBuild$ at at at hudson.model.ResourceController.execute( at Finished: FAILURE
550 Invalid recipient: < my company email address>

That's the problem - for some reason either the way you set the name is wrong or the server does not recongize it. Can you post the address (use john smith as a name and as the company - I just need to see the way it is written).
ashish_gautamAuthor Commented:

The way it is used is . This is the format I used it and  Our organisation do not uses .com To be more precise it would be

Can some help be provided
Chris DentPowerShell DeveloperCommented:

Venabili already pointed out the problem though.

> 550 Invalid recipient: < my company email address>

This is a response from MS Exchange Recipient Validation component.

You need to send to a valid internal recipient or you need to get details of a relay from your mail system administrators so you can pass mail through.

Either way, it's a mail system or e-mail address problem (the latter is more likely), not a code problem.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Are you able to send a mail to the same address from another place (your mail client for example?)
ashish_gautamAuthor Commented:
Yes I am able to send mail from the Outlook client configured on my pc .
Had you ever been able to send a mail to that address from the same computer where the tool runs now?

Basically at this point I would go and speak with the Exchange Admins -- with the error - so that they can tell you if the restriction comes from the Exchange and if they can allow you send mails through it. The Javamail works - it is something out of the Java that does not relay the message all the way out. And the only people that can tell you what are the ones that manage your email network
ashish_gautamAuthor Commented:
It needs a lot of followup from organisation deaprtment
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.