Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

emailing functionality is not working  RSS feed

 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • 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
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you edit your post, we may cut'n' paste it to our editor for syntax-highlightening.
If you put [ code], [ /code] tags around your code (without the blanks), it will keep your indentation - if you have one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!