Bugzilla 4.4 and newer support Gmail as SMTP server natively, without any need to hack the source code. When running checksetup.pl, make sure that Net::SMTP::SSL is installed:
Checking for Net-SMTP-SSL (v1.01) ok: found v1.01
Then edit the following parameters (under Administration > Parameters > Email):
mail_delivery_method = SMTP mailfrom = firstname.lastname@example.org smtpserver = smtp.gmail.com:465 smtp_username = email@example.com smtp_password = your_gmail_password smtp_ssl = on
Do not forget to save your changes. And that's all, Bugzilla can now use your Gmail account to send email notifications.
If you are running Bugzilla 4.2 or older, then you should apply this patch. Once applied, you can follow the steps above.