• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending mails outside intranet

 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are doing a project in which we need to send automated mails. We are using javax.mail API to send mails.

But we are able to send mails only within our institute intranet and not outside like yahoo, gmail Ids.

Please let me know how to send mails outside intranet.

Another group is doing the same feature in .NET. So it is not an issue with the SMTP server.

Thanks in advance,
Vinayak
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to go out on a limb and say your problem is not related java but your network setup. It may not have access to the internet, or more likely, blocks certain ports from being called remotely.

As long as your addressing the messages in the same manner such as me@mynetwork.com versus me@gmail.com, there's nothing that prevent it from being delivered.
 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are able to send mails outside using "OutLook Express".

Also another team is doing the same using .NET.

So I feel there is a way in Java to do the same, something we are unaware of.

This is the code we are using now :



-Vinayak
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify the SMTP server name/ip and the key ("mail.smtp.host") in the properties object that you are passing to Session.getInstance is correct.

From the computer running the program, try connecting to the SMTP server on port 25 using telnet. If you can't connect then you have a networking issue.

If that doesn't fix the problem, what exception is being thrown?
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to join Scott on that limb and suggest your problem is that the server won't relay e-mail messages from other computers. This is standard configuration for SMTP servers nowadays.

Probably those other systems can relay because they are authenticating themselves with the server. Your program may have to do the same. At any rate, the administrator of the SMTP server should be able to clear up any doubts you might have. Go and ask.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic