File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

emailing functionality is not working

 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Friday 30 April 2004 18:50, Jignesh Patel wrote:
> HI All,
> Whenever I tried to send to other email address then the bangracing.com it
> says relaying denied as follows however it works fine for one domain bangracing.com 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 <jpatel@bangtechnology.com>:
> Relay access denied
>
> my code is as follows:
>
> Properties properties = System.getProperties();
> properties.put("mail.transport.protocol","smtp");
> properties.put("mail.smtp.host","mail.bangracing.com");
> Session session = Session.getInstance(properties,null);
> MimeMessage message = new MimeMessage(session);
>
> try{
> message.setFrom (new InternetAddress("jpatel@bangracing.com"));
> message.setRecipient(Message.RecipientType.TO, new
> InternetAddress("jpatel@bangtechnology.com"));
> message.setSubject("Nutzz New Customer Inquiry Detail");
> String messageText = emailText;
> message.setText(messageText);
> Transport.send(message);
> }
>
> -Jignesh
 
danny liu
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check whether both original and target mail servers are accessible.
check if there is a firewall.
Dan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic