• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Email Host Configuration Problem

 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a Java based Web application which has to send an email to the user. In my home, I have an outlook express and I don't have any mail server.
Suppose i want to send an email to different user like [email protected], b@rediffmail how can I configure the host and its user name and password.

Whether i need to install any personal mail server in my local machine and I have to use my local machine host for this purpose. If it is, what personal open source mail server is available and how to configure it.

If it is not required to install any mail server in my local machine, how can I configure the host and username and password. Since I can't able to get the Yahoo Mail Server Host and it's username and password. Please through some light on it.

But I have configured my outlook express with POP3 Yahoo mail Server. So whatever, mail I am getting in yahoo mail server will be accessed through my outlokk express.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This JavaMail tutorial has plenty of examples on how to send and receive emails using Java, including using authentication.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I goolged in net for sending and receiing mail I have the following assumption.
For sending the email we have to use SMTP. For example If I want to send an email to the user like [email protected], then I have to use the SMTP Server/Host name of the yahoo mail server. Even If I am using the Yahoo Host name, it has to accept it. Since it may consider the incoming mail can be a spam.
Though, If I am having a free account with Yahoo, I have heard that it won't allow to talk with their(Yahoo) SMTP server. For this purpose we need to have a paid in yahoo account.

My Doubts:

1. I don't have a paid in yahoo mail account.
2. I want to send a mail to the user which can be a different mail account like gmail,hotmail (ex: [email protected]. [email protected]).
In this case how can i use the host name? which host name I have to give yahoo,gmail..?
I have used the below program for sending the mail, but I am getting the error:



ERROR:
=========


Why I am getting the AuthenticationFailedException? How to resolve it? Whether I can abvle to send to only one type of host like either yahoo or gmail or rediff?
Why I am getting the FileNotFoundException?



What these files will contains? Whether I have to place this files in the required locations?

[ November 28, 2007: Message edited by: Micheal John ]
[ November 28, 2007: Message edited by: Ulf Dittmer ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The files are not important, but providing authentication is. That's why I suggested to consult the code examples in the page I linked to. It shows how to do all that.

But it still isn't going to work, because -as you correctly mention- Yahoo doesn't allow SMTP access for its free acounts.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what will be work around for this? I cannot able to send mail to any host?Whether yahoo only not allowing to access its SMTP server for its free mail account or gmail, hotmail, rediffmail also remain the same(they are also not allowing?) Is there any mail server which also to access their SMTP server. My purpose of accessing SMTP server is to send an mail to user. If any, I will create a account with them?

I just want to test my java program to send a mail to the user. I am developing a product, which later don't have this issue. Since the company which is going to use this product will have their own mail srver and mail wil be send to the user in that company only. So it don't have a problem.

Suppose I am doing this product for ABC copmany, they will have the domain and all thy user belongs to the company will have the mail id like [email protected],[email protected]. so their mail server will send the mail.

Right now I don't have any set up and how can I test it.please throw some light on it. Please give some work around for this.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either use your company's email server -which presumably allows this-, or run an email server like James -which is very easy to set up- on your local machine.
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..
Using Configuring Apache James in my machine, I can able to send mail to any user/ any restriction is there?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Using Configuring Apache James in my machine, I can able to send mail to any user?


Yes.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have configure Apache James with my system successfully and I have create a user and used a program to send a mail to the user. In this case I have used domain as localhost. Now for domain can I use yahoo.com, gmail.com. If it not possible I would like to configure my outlook express for the localhost domain.

For example:
I will create the user like [email protected], [email protected]..... using the Apache james. Then I am trying to configure outlook express and while configuring, it asking for POP3 and SMTP setting. What i have to give in this case? If it configured I will send the mail from my program so that I can able to get the mail in the outlook express in the offline. Am I right or it need to have a internet connection. I know in case of yahoo.com, gmail.com we need internet..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll always need an internet connection to send email; how else would it get to the recipients? Some mail servers may cache mails if the connection is currently down; I'm not sure if James does that.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I thought was even if we have Apache mail server how the Yahoo SMTP server will accept to access it? So I thought using James we can create a new user and password with some dummy domains and we can configure the outlook express account to receive the mail from the program locally without any net connection.
No Problem.. I somewhere misunderstood. so do you mean to say that I can configure the James xml file to give Yahoo domain. I have a free yahoo email account and can I use that?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

so do you mean to say that I can configure the James xml file to give Yahoo domain.


No. Yahoo accounts are serviced by Yahoo's email servers. In any case it's not a good idea to configure a mail server on a machine that (in all likelihood) is not reachable from the net via SMTP because of firewall restrictions, and which is not always running.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so I cannot send mail to yahoo/gmail using james server.
What I want is just to send an email from a java program and I should able to see the mail which I had sent thru java pgm in the outlook express using apache james or by others. How can I do it? How to configure the outlook express for it. Since you are advising that it not possible to send it to yahoo/gmail free email user accounts
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

so I cannot send mail to yahoo/gmail using james server.


Not if the objective is to do this without a network connection.

What I want is just to send an email from a java program and I should able to see the mail which I had sent thru java pgm in the outlook express using apache james or by others.


In that case, add a new account in Outlook that uses "localhost" as its server for both SMTP and POP3. This account needs to corresond to a James account that you need to set up first. Then you can use Outlook to send and receive mail through James.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much for your reply and so if I have internet connection, then I can able to send to yahoo/gmail also. How to configure the config.xml in James server for yahoo mail server.
In domain I have given yahoo.com and rest of the things I have the confusion. If my machine is connected to internet and I am getting the DNS Server name and given that too in config xml file. That's enough or we need to do any other configurations
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

How to configure the config.xml in James server for yahoo mail server.
In domain I have given yahoo.com and rest of the things I have the confusion.



I think you're a bit confused about how email works. There is nothing to configure for sending email to any domain. Just use the @yahoo.com email address in the JavaMail client code, have it connect to James, and it will deliver the email to your Yahoo account. Since Yahoo is not part of your local network, you will need an internet connection for that, though (which you said before you wanted to avoid). As mentioned above, Yahoo mail can't be handled locally in the sense that it can be delivered to or received from a local mail server; all you can can do is send it locally.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search for topic "Connect to SMTP server", I have submitted code to send email through gmail and it works.

Regards
Sanjay Mistry
 
Greenhorn
Posts: 6
Tomcat Server Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf

Thanks for the precise explantion
Even I am facing the same issue as Micheal...

Installed JAMES ,added a user to it say ratan@localhost
but I am not able to send mails to gmail account.

A step by step approach will be helpful...
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic