• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1324
  • Last Modified:

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)


0
ashish_gautam
Asked:
ashish_gautam
  • 5
  • 5
2 Solutions
 
VenabiliCommented:
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
0
 
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 ??
0
 
VenabiliCommented:
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)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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(SMTPTransport.java:1388) at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1215) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:586) at javax.mail.Transport.send0(Transport.java:169) at javax.mail.Transport.send(Transport.java:98) at hudson.tasks.MailSender.execute(MailSender.java:97) at hudson.tasks.Mailer.perform(Mailer.java:99) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550) at hudson.model.Build$RunnerImpl.post2(Build.java:152) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528) at hudson.model.Run.run(Run.java:1221) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) Finished: FAILURE
0
 
VenabiliCommented:
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 company.com as the company - I just need to see the way it is written).
0
 
ashish_gautamAuthor Commented:
Hi

The way it is used is john.smith@company.com . This is the format I used it and  Our organisation do not uses .com To be more precise it would be john.smith@xxx.co.xx

Can some help be provided
0
 
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.

Chris
0
 
VenabiliCommented:
Are you able to send a mail to the same address from another place (your mail client for example?)
0
 
ashish_gautamAuthor Commented:
Yes I am able to send mail from the Outlook client configured on my pc .
0
 
VenabiliCommented:
OK.
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
0
 
ashish_gautamAuthor Commented:
It needs a lot of followup from organisation deaprtment
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now