'; $subject = 'Nouveau message du Pifolio !'; $body = "Nom: $name $surname\n\nE-mail: $email\n\nMessage:\n$message"; $headers = array( 'From' => $from, 'To' => $to, 'Subject' => $subject ); $smtp = Mail::factory('smtp', array( 'host' => 'ssl://smtp.gmail.com', 'port' => '465', 'auth' => true, 'username' => 'cailloux.p03@gmail.com', 'password' => 'passwordxxx' // Replace with your email password )); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo('

' . $mail->getMessage() . '

'); } else { echo('

Message successfully sent!

'); } } else { echo('

Invalid input. Please check your details and try again.

'); } } ?>