• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What if i don't have any SMTP email Server

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic