no problem...
1. I don't know any good sites that pull those frameworks together into one application. I think Spring may have some example wars in their distribution. If you download spring there is a samples directory that they have war files/source code. I'm pretty sure they have a spring/hibernate example and a spring mvc vs.
struts example. so you can see the diffs between spring mvc and struts. Other than that, I have been thinking about putting together a sample application that would just be downloaded and ready to run. Using Derby for a database, apache James for smtp server (only to send emails) and struts/spring/hibernate or spring/hibernate (using spring mvc). But I haven't had much time to get this done.
To learn these frameworks it's just taken time and a lot of examples and trial and error with me. I like to learn the basics of them first and then build off of them, but learning new frameworks takes time.
2. You are correct, an smtp server is just an email server that sends and receives emails. So if you want anything to get past your computer you will have to be connected to the internet (for example you have to connect to gmail's smtp server at smtp.gmail.com, if you ping smtp.gmail.com you'll see it's ip address on the internet). You can test locally, for example I use JAMES to send email to an email account on localhost (my local computer) from localhost. So I have my JAMES email server sending and receiving emails from itself.
On a side note, it's funny you mention gmail I was just writing code to use gmails smtp server last night using spring, currently I use godaddy's with my account there. I started wanting to use gmail because I signed up for google apps, which is really nice.
It is possible but I ran into a few issues because gmail uses ssl. I looked all over the internet and the only solution I found was people rewriting spring's javamailsenderimpl class. but I actually found a way to do it.
take a look at the api. I use this class to send emails.
http://www.springframework.org/docs/api/org/springframework/mail/javamail/JavaMailSenderImpl.html here's my settings, and it worked for a while until I changed the from address from my account to a
[email protected] then all the emails like hotmail and gmail blocked the reception of the email.
host = smtp.gmail.com
username =
[email protected] password = yourGmailPassword
port = 465 // or you can use port 587
protocol = smtps
//the setJavaMailProperties I use
mail.smtps.auth=true
mail.smtp.starttls.enable=true
// i can't remember if I used that or below:
mail.smtps.starttls.enable=true
took this from the following link:
http://forum.springframework.org/showthread.php?t=17638 I don't do it the way above, I actually use spring to configure my mail sender and inject the sender into my services. but it'll do the same thing. I can't totally remember the code I wrote but if something's different I'll post it later.