• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Java Mail : Relaying Denied

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i wrote 1 java mail program,

I am getting

javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class com.sun.mail.smtp.SMTPSendFailedException: 553 sorry, relaying den
ied from your location [122.165.23.198] (#5.7.1)

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1072)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:492)
at javax.mail.Transport.send0(Transport.java:151)
at javax.mail.Transport.send(Transport.java:80)
at Mailapp.send(Mailapp.java:67)
at Mailapp.main(Mailapp.java:22)

Please give me your suggestions
 
Kevin Weiss
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this is because your host isn't allowed to send mail to (or through) your mail relay server.

Where are you sending the email from, and where are you sending the email to (i.e. which SMTP server)?
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my from address is my company
email id : edward@dcomsols.com
smtp : smtp.dcomsols.com

to address : edward_durai@hotmail.com

is any other settings available to enable to send emails to other e-mails.

please give me your suggestions.

thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The mail server doesn't like the IP address from which you're sending. This is a common thing for company servers - they only allow email to be sent from within the company network. You can try talking the email admins into relaxing this rule.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Talk to the sysadmin of your mail server.

They can add your system to the allowable relay hosts, or they might tell you to use SSH port tunneling to connect at a system to system level. With ssh port tunneling, you will need to tweak the port and host of your code calling the SMTP routines
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your mails.

from outlook express, i have configured my company id.

using outlook, I am able to send mails to any e-mail id.

but why i am not able to send using java mail program?

still i have a confusion.

please tell me your suggestions.

thanking you.
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is your email account configured in Outlook? Does it allow you to send emails from that address? And how do you connect to the mail server in your Java code?
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir,

I have given the following details for both Outlook and Java Mail Program

1. Incoming Server Name(POP3) : mail.dcomsols.com port 110
2. Outgoing Server Name(SMTP) : smtp.dcomsols.com port 25
3. User Id : username@dcomsols.com
4. Password: userpassword

These are the information, I have given.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the authentication callback in the JavaMail code ever called?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So both Outlook and Java use POP3?
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in java for authentication,

props.put("mail.smtp.auth", "true");

yes. both outlook and java mail program for pop3 only.
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how do you specify the username and password? Are you setting the properties "mail.smtp.user" and "mail.smtp.pass", or are you using an Authenticator? Or both? Or none?
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Rob,

I have given username, password and also enabled authentication also.

thanks. please let me know, if you have any more question.

please give me your suggestion.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!