Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set SMTP server

 
jaya lakshmi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am new to Java mail. I have tested a mail send program. It is working on smtp.sify.com and it is sending mail only when "To" address created in Sify mail server. I tried to use smtp.yahoo.com & smtp.gmail.com and not working. Please help me.

Thanks in advance

jayalakshmi





 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jayalakshmi,

In order to send mail you need to access and mail server. You may not use yahoo or gmail since you are not authenticated to use it. You need to give your user name and password to use that server for sendin mail.

For sending and receiving mails you can use

Apache James server. Take sometime learn e-mail basics and especially James server so that you can set up your own mail server on your machine and send and receive them.

Regards
 
Arun Prasath
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Mail API can be only used as a mail client. Not as a mail server.

For reading mails we connect to pop3 server and retrieve mails from the server.
You will be able to receive mails from yahoo and gmail.com only if you have pop access in their servers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic