Wampserver & Formulaire MAIL

Salut a tous!

alors voila je vous expose mon problème!

Je suis sou Vista et je possède Wampserver 2.0

mon problème c’est que je n’arrive pas a envoyer de mail ver une adresse mail distante (Mon mail)

je vous donne mais scripts

Mon codage PHP

<?php $TO = "MonMail@gmail.com"; $h = "From: " . $TO; $message = ""; while (list($key, $val) = each($HTTP_POST_VARS)) { $message .= "$key : $val\n"; } mail($TO, $subject, $message, $h); Header("Location: [url=http://MonSite");]MonSite");...[/url] ?>

Mon formulaire (dans une page html)

Votre Nom:
Votre Email:
Sujet:
Commentaires:

-

Ma config Wampserver

[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 25

; For Win32 only.
sendmail_from = MonMail@gmail.com

Et voila les erreur du PHP error log

[24-Dec-2008 21:26:00] PHP Warning: Variable passed to each() is not an array or object in D:\HTTP\formmail.php on line 8

[24-Dec-2008 21:26:00] PHP Notice: Undefined variable: subject in D:\HTTP\formmail.php on line 12

[24-Dec-2008 21:26:00] PHP Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. d4sm11761059fga.41 in D:\HTTP\formmail.php on line 12

Voila!

Quelqu’un aurait t’il une solution?

Merci d’avance pour vos reponce

S@m
Edité le 24/12/2008 à 21:37

while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}

Cela ne risque plus de fonctionner ça…

Tente :

foreach ($_POST as $key => $val) {
$message .= "$key : $val\n";
}

Fait un tour sur le site de php pour en savoir plus sur foreach

Salut!

Merci de ta réponse aussi rapidement^^

mais mon problème persiste encore :frowning:

voila mon rapport d’erreur

08 22:09:37] PHP Notice: Undefined variable: mywampfp in C:\wamp\scripts\refresh.php on line 252
[24-Dec-2008 22:09:37] PHP Notice: Undefined variable: i in C:\wamp\scripts\refresh.php on line 252
[24-Dec-2008 22:09:37] PHP Notice: Undefined variable: mywampini in C:\wamp\scripts\refresh.php on line 252
[24-Dec-2008 22:09:37] PHP Notice: Undefined offset: 1 in C:\wamp\scripts\refresh.php on line 385
[24-Dec-2008 22:09:37] PHP Notice: Undefined offset: 1 in C:\wamp\scripts\refresh.php on line 385
[24-Dec-2008 22:09:48] PHP Notice: Undefined variable: subject in D:\HTTP\formmail.php on line 12

[24-Dec-2008 22:09:48] PHP Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. l12sm7147832fgb.8 in D:\HTTP\formmail.php on line 12

sinon jais tenter avec ceci

Le code PHP

<?php mail(' SamSir69@gmail.com', 'subject', "message\nLigne 2\n"); ?>

LE Message d’erreur

[24-Dec-2008 22:57:33] PHP Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. p9sm4689190fkb.18 in D:\HTTP\formmail.php on line 3

Cordialement!

s@m
Edité le 24/12/2008 à 22:59

Re!

jais réussi sayer!^^

Il suffisez de mettre SMTP = smtp.free.fr

et non SMTP = smtp.gmail.com

^^

voila merci de ton aide;)

par contre jais une autre problème!

lorsque je reçoit le mail,l’expéditeur appairer sou MON adresse mail (Adresse sur la quel le mail a été envoyer quoi)

Bonne nuit^^

S@m