A little info on your OS, web browser, and email client would be appreciated. Here's some info from my experiences, which may be very similar to yours (I have been unable to send email through port 25 on my D-Link router either):
I take it that you may be using Mail for your email. If you have DSL from AT&T, then this may be why. My laptop will not send email through port 25 on my internet connection, but you can try port 587.
Follow the instructions in here... they're a bit outdated but it worked for me in Tiger and in Leopard when I have had to reset all my preferences.
Have you tried using network diagnostics in Safari? Or are you using a different browser? Also, what type of security does you connection have, assuming you use WEP or WPA? I'm curious as to why your connection may be failing even though it's connected to the router. You know, lately my connection quits when AirPort is connected and the wireless signal is strong, but the internet on my wired PC works. I switched my security to WPA2, which has always worked better for me, and have not had a problem. I wonder if it's just D-Link issues since my MBP's replaced AirPort card runs extremely fast until it drops it... but not anymore. My MBP registers my connection as four bars when I'm just in the next room, but that's with security on. Unprotected signals are blazing fast and always have five bars... go figure.
Anyway, see if this info helps you out.
-BMF
I have an ibook G4. I connect using a d-link wireless connection. The connection is strong as all the bars are showing. When connecting to the web it says server not found. When retrieving e-mail it says server can't connect to port 25. I tried pinging www.excite.com and it didn't work. This started a week ago.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic