Ciao, cercando in rete ho trovato questo codice che fa proprio al caso tuo...in ogni caso per mandare un messaggio di posta con la funzione mail() facendo sì che tu la mandi con l'account gmail, hai bisogno di loggarti al server smtp di gmail, non ha nulla a che vedere con la tua configurazione "locale" di php, quindi non devi andare a cambiare nulla nel php.ini
Ti posto l'esempio che ho trovato, non l'ho provato quindi non posso garantirti che funzioni...
Codice PHP:
<?php
require_once "Mail.php";
$from = "Sandra Sender <sender@example.com>";
$to = "Ramona Recipient <recipient@example.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
// stick your GMAIL SMTP info here! ------------------------------
$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";
// --------------------------------------------------------------
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("
" . $mail->getMessage() . "</p>");
} else {
echo("
Message successfully sent!</p>");
}
?>
Spero ti sarà utile