Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes emailing functionality is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "emailing functionality is not working" Watch "emailing functionality is not working" New topic

emailing functionality is not working

Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

On Friday 30 April 2004 18:50, Jignesh Patel wrote:
> HI All,
> Whenever I tried to send to other email address then the it
> says relaying denied as follows however it works fine for one domain except others. Can any body guide me what is the reason
> for not sending emails.
> message:
> MessagingException:Sending failed;
> nested exception is:
> class javax.mail.SendFailedException: Invalid Addresses;
> nested exception is:
> class javax.mail.SendFailedException: 554 <>:
> Relay access denied
> my code is as follows:
> Properties properties = System.getProperties();
> properties.put("mail.transport.protocol","smtp");
> properties.put("","");
> Session session = Session.getInstance(properties,null);
> MimeMessage message = new MimeMessage(session);
> try{
> message.setFrom (new InternetAddress(""));
> message.setRecipient(Message.RecipientType.TO, new
> InternetAddress(""));
> message.setSubject("Nutzz New Customer Inquiry Detail");
> String messageText = emailText;
> message.setText(messageText);
> Transport.send(message);
> }
> -Jignesh
danny liu
Ranch Hand

Joined: Jan 22, 2004
Posts: 185
check whether both original and target mail servers are accessible.
check if there is a firewall.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13005
Relay access denied -
May mean that the server does not recognize the from address as being a user who can legally mail through that system. It thinks you may be a spammer.
Have you checked out Aspose?
subject: emailing functionality is not working
jQuery in Action, 3rd edition