• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please help!!!!!which protocol?

 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all ,
my question here is , because i am setting the protocol type here in properties and in the transport type for sending the message, will it go only to the servers that support smtp, i want to send e-mail to all the systems what ever they use, yahoo ,hotmail etc.

please help.


//Set the host smtp address
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.jcom.net");

// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);

Transport transport = session.getTransport("smtp");
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

will it go only to the servers that support smtp

That's just naming the server not defining the protocol. The part of JavaMail which is protocol dependent is the Transport implementation. The only implementation provided with JavaMail is SMTP. You could write your own if you wanted to communicate with other non-SMTP mail servers.


i want to send e-mail to all the systems what ever they use

How many are you connecting to? Surely you will know what protocol a particular server uses if you are connecting to it, and be able to create the appropriate Transport for a particular session?
 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks paul,
I dont know what the props.put is , i mean what
props.put(" ") is , i mean the smtp host, where should i look at to get that information, my company is in a secure network, can you help me in giving some tips on this.
thanks
pradeep
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your SMTP host is the mail server you want to use. You open a Session on it with the name as the mail.smtp.host Property. To find that information, I'd look at your company network and find an SMTP server - if your company has one.
 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks paul , I will do that and get back to u if i have any questions.
thanks
Pradeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic