On Tue, May 4, 2010 at 18:04, Dam74 <
damien...@hotmail.com> wrote:
> My Java/Play application is currently hosted on "
stax.net" and they do
> not provide any mail solution.
You don't need them to provide any mail solution. What you do need is
to be able to listen on port 25, and since stax is servlet I don't
know whether it's possible or not.
Maybe your current workaround is the only way.
> I don't know anything about email programming...
> I managed to read the mails of a GMail account by IMAP using JavaMail
> as advised by Ivan.
> But you're saying (and I think you are right) that polling regularly
> (like every min) to the GMail account "sucks",
> and that I might be banned from GMail if they detect it has harmfull.
They probably won't ban you (as people could configure their email
client to check email every minute) but it's sub-optimal to have to
check at regular interval.
> But how can I do like you are suggesting ? :
> "
>> SubEtha SMTP seems pretty popular:
http://code.google.com/p/subethasmtp/
>> It's a lib that lets you start a server on application start, then you
>> can define handlers that get called when a new message arrives.
>
> "
> => can you explain that ? Where these new messages would arrive ?
> In my GMail account ? or nothing to do anymore with any external mail
> server and this is a real self sufficient mail server ??
> I thought that SMTP was for SENDING only, not RECEIVING mails ? Is
> that right ?
You may think that by configuring an email client, but from a server
point of view SMTP is both for sending and receiving.
For example, when a Hotmail user sends an email to your gmail account,
Hotmail's SMTP sends the email to GMail's SMTP who stores it. Then you
can see it from the web interface of GMail, or retrieve it with POP
or IMAP. So GMail's SMTP is actually receiving the message.
When you have your own SMTP server, it gets messages directly from
other SMTP servers and you skip the part where the user fetch it
through POP or IMAP.
> I do not have any Domain name for the moment...
> So, even without one, Can I put in place a mail server within my
> JavaApplication ?
> Will this be able to send and, most important, RECEIVE mails ? If yes,
> which would be the email address ? (what would it look like?)
> I would really me interested in a deeper explanation of your proposal.
What you need is:
- A machine (physical or virtual) with a public IP address
- The possibility to listen on the port 25 of this machine
The right part of the email address would be the address of the
machine. It can be on a subdomain, with email like
con...@myservice.stax.net (if they provide these kind of subdomains).
You can also get a free domain on
eu.org or
dyndns.org and map it on
the IP you have. Anyway, domains are cheap now...
Again I don't know if you can listen on port 25 on stax, maybe it's
not possible.
> Thanks in advance.
>
> Other solution than GMail, I'm investigating if
http://sendgrid.com/
> would provide any advantage compared to GMail...
It looks like something like mailchimp, to do mass mailing. First of
all it's to send email, not receive them, and the only benefit of
these services are:
* Be able to send a lot of emails in a short period of time
* Do so without being marked as spam
If you don't want to do a newsletter you probably don't need that.