• Post Reply Bookmark Topic Watch Topic
  • New Topic

What if i don't have any SMTP email Server  RSS feed

 
Talha-bin -Shakir
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should i replace if i don't have any SMTP email server name in this line of code.

props.put("mail.smtp.host", "smtp.mail.example.com");

and how would i know that the mail has sent if m running my application on my local host.
Please m so confuse.
[ December 20, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No SMTP server means no email. You won't be able to run the code successfully without one.
 
Talha-bin -Shakir
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i write "localhost" or something like this. and if i must have a email server so how i will check my code on my localhost? is there any other way .
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing stops you from running an email server on your local machine, just like you run Tomcat locally. Since you're familiar with Java, have a look at Apache James, which is an open source email server written in Java.
 
Rashid Mayes
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used the smtp server included with Windows Services For Unix (SFU). Its a free download and will give you many of the unix commands and several of the daemons. The link is http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx

I have not used it lately but it should work well for you. Now I have a dedicated Linux box that I use for sending and testing email.

Apache James, as mentioned, is a good option also. I use it in production to route email for one of our projects involving virtual domain hosting.

As an aside, and only if you have curiosity and free time, it its possible to find the MX record and talk directly to the mail server that handles the mail for a recipient. Let me state again that is not a viable solution to the problem described in your post. The com.sun.jndi.dns.DnsContextFactory will enable you to find the MX record. This is per recipient, most mail servers are not (and should not be) open relays. This could be done before each send or within the JavaMail API which is now open source.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's clear that this has gone beyond JSP, so I've moved it to the Other Java APIs forum where JavaMail is discussed.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!