In the latest version of mail.app in Leopard, some of the fields have moved. I had some trouble sending mail because I was used to the older version, and I couldn’t find the field for setting the SMTP port and authentication. Anyway, I have it up and running now, so I figured I’d post some screenshots.
First, in your Gmail settings, make sure you have either POP or IMAP enabled, depending on which you want to use. Then, open the Preferences for mail.app.
Click on “Accounts” in the top menu, then Account Information. Enter whatever you want into the Description field. Then enter the address you would like to use as your reply-to address into the Email Address field (probably your Gmail address). For your username, enter your Gmail username (without “@gmail.com”).
In the “Advanced” area, enter port 993, 995 or possibly 465.
Back in “Account Information,” click the “Outgoing Mail Server (SMTP)” dropdown and select “Edit Server List.”
Enter a description if you want, and enter “smtp.gmail.com” as the server name. In the Advanced area, enter port 587, select “Password” in the Authentication menu and enter your Gmail username (again without “@gmail.com”) and password.
That should do it.