IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Envoyer un e-mail en localhost


Sujet :

Langage PHP

  1. #1
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut Envoyer un e-mail en localhost
    Bonjour,

    J'utilise XAMPP comme serveur local, je voudrais envoyer des e-mails depuis mon localhost, quelles sont les étapes a suivre.

    Cordialement

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Bonjour,

    Il faut juste demarrer mercury.

  3. #3
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Bonjour,

    Il faut juste demarrer mercury.
    J'ai teste mais les messages ne s'envoient pas, message d'erreur:

    Error! The message was not successfully sent!

  4. #4
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    A quel niveau as-tu ce message ?
    Vois-tu passer ton mail dans Mercury ?

  5. #5
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par sabotage Voir le message
    A quel niveau as-tu ce message ?
    Vois-tu passer ton mail dans Mercury ?
    quand je rentre sur http://localhost/xampp/mailform.php je remplis la forme avec l'e-mail de l'expéditeur et le destinataire, il m'affiche ce message d'erreur

  6. #6
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Peut-on voir ce mailform.php ?

  7. #7
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Peut-on voir ce mailform.php ?
    mailform.php:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
     
    <?php
    	include "langsettings.php";
    	// Requests allowed only from localhosz
    	extract($_POST);
    	extract($_SERVER);
    	$host = "127.0.0.1";
    	$timeout = "1";
     
    	if ($REMOTE_ADDR) {
    		if ($REMOTE_ADDR != $host) {
    			echo "<p><h2> FORBIDDEN FOR CLIENT $REMOTE_ADDR <h2></p>";
    			exit;
    		}
    	}
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	"http://www.w3.org/TR/html4/loose.dtd">
    <html>
    	<head>
    		<meta name="author" content="Kai Oswald Seidler, Kay Vogelgesang, Carsten Wiedmann">
    		<link href="xampp.css" rel="stylesheet" type="text/css">
    		<title>Mercury Mail Server</title>
    	</head>
     
    	<body>
    		&nbsp;<p>
    		<h1><?php echo $TEXT['mail-head']; ?></h1>
    		<i>(Requests allowed from localhost only)</i><br/><br/>
    		<a href="mercury-help.php"><?php echo $TEXT['mail-hinweise']; ?></a><br><br>
     
    		<form method="post" action="mailsend.php">
    			<table width="600" cellpadding="0" cellspacing="0" border="0">
    				<tr>
    					<td align="left" width="200"><?php echo $TEXT['mail-adress']; ?></td>
    					<td align="left" width="400"><input type="text" name="knownsender" size="40" value="postmaster@localhost"></td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200"><?php echo $TEXT['mail-adressat']; ?></td>
    					<td align="left" width="400"><input type="text" name="recipients" size="40" value="admin@localhost"></td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200"><?php echo $TEXT['mail-cc']; ?></td>
    					<td align="left" width="400"><input type="text" name="ccaddress" size="40"></td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200"><?php echo $TEXT['mail-subject']; ?></td>
    					<td align="left" width="400"><input type="text" name="subject" size="40"></td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200">&nbsp;</td>
    					<td align="center" width="400">&nbsp;</td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200"><?php echo $TEXT['mail-message']; ?></td>
    					<td align="left" width="400"><textarea rows="6" name="message" cols="34"></textarea></td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200">&nbsp;</td>
    					<td align="center" width="400">&nbsp;</td>
    				</tr>
     
    				<tr>
    					<td align="left" width="200">&nbsp;</td>
    					<td align="left" width="400"><input type="submit" value="Send"> * <input type="reset" value="Reset"></td>
    				</tr>
    			</table>
    		</form><br><br>
    <br>
    		######## <a href="http://localhost:2224" target="_new"><i>Mercury HTTPD Server listen on Port 2224</i></a> ########
     
    	</body>
    </html>
    langsettings.php:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <?php
            $lang=@file_get_contents("lang.tmp");
            @include("lang/languages.php");
            @include("lang/en.php");
            @include("lang/$lang.php");
            if($lang=="zh")
            {
                    header("Content-Type: text/html; charset=gb2312");
            }
            else if($lang=="jp")
            {
                    header("Content-Type: text/html; charset=shift-jis");
            }
    ?>

  8. #8
    FoxLeRenard
    Invité(e)
    Par défaut
    Je n'aimes pas beaucoup tester 10 trucs en même temps ...

    Peux tu juste copier ça dans un test.php
    et voir quand ça marche

    En ne touchant surtout a rien sauf ton mail tonmail@wanadoo.fr
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    <html><body>
    <?PHP
          mail("A:   <tonmail@wanadoo.fr>", "Objet: Message du local\n\n\n", "Texte : =========================== \n\n\n\n" ,  "From: dupond <dudond@wanadoo.fr>");
    ?>
    </body>
    </html>

  9. #9
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par FoxLeRenard Voir le message
    Je n'aimes pas beaucoup tester 10 trucs en même temps ...

    Peux tu juste copier ça dans un test.php
    et voir quand ça marche

    En ne touchant surtout a rien sauf ton mail tonmail@wanadoo.fr
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    <html><body>
    <?PHP
          mail("A:   <tonmail@wanadoo.fr>", "Objet: Message du local\n\n\n", "Texte : =========================== \n\n\n\n" ,  "From: dupond <dudond@wanadoo.fr>");
    ?>
    </body>
    </html>
    voila la reponse du serveur:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in

  10. #10
    FoxLeRenard
    Invité(e)
    Par défaut
    voila la reponse du serveur:
    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in .......
    Ok donc dans tes trois php.ini tu cherches
    SMTP
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    [mail function]
    ; For Win32 only.
    SMTP = smtp.wanadoo.fr
    smtp_port = 25
     
    ; For Win32 only.
    sendmail_from = xxx@wanadoo.fr
     
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =

  11. #11
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par FoxLeRenard Voir le message
    voila la reponse du serveur:


    Ok donc dans tes trois php.ini tu cherches
    SMTP
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    [mail function]
    ; For Win32 only.
    SMTP = smtp.wanadoo.fr
    smtp_port = 25
     
    ; For Win32 only.
    sendmail_from = xxx@wanadoo.fr
     
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =
    j'ai change deux fichier php.ini mais reste comme ca:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in

  12. #12
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Est-ce que mercury est bien demarré ?

  13. #13
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Est-ce que mercury est bien demarré ?
    oui, avec cette erreur:

    Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in

  14. #14
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Dans Configuration - SMTP server - Connection control
    Tu autorises 127.0.0.1 avec l'option "relay" cochée.

  15. #15
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    425
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 425
    Points : 90
    Points
    90
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Dans Configuration - SMTP server - Connection control
    Tu autorises 127.0.0.1 avec l'option "relay" cochée.
    ou je vais trouver "Configuration"

  16. #16
    FoxLeRenard
    Invité(e)
    Par défaut
    Si tu permets, je reviens sur un détail tout bête, quand tu as changés tes INI et configs, bien sur tu as tout arrété et redémarré

  17. #17
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    ou je vais trouver "Configuration"
    dans mercury

  18. #18
    FoxLeRenard
    Invité(e)
    Par défaut
    Bon quand on a tort faut le dire,
    Pour EasyPhp c' est impossible sans un serveur SMTP même en changeant les paramétres,

    Je crois que je vais changer pour XAMPP mais j'espéres qu'il est pas trop compliqué

  19. #19
    Expert confirmé
    Avatar de Thes32
    Homme Profil pro
    Développeur PHP, .Net, T-SQL
    Inscrit en
    Décembre 2006
    Messages
    2 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Développeur PHP, .Net, T-SQL

    Informations forums :
    Inscription : Décembre 2006
    Messages : 2 379
    Points : 4 853
    Points
    4 853
    Par défaut
    Salut,

    As tu un serveur smtp sur ta machine ?

  20. #20
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par thes32 Voir le message
    Salut,
    As tu un serveur smtp sur ta machine ?
    Non mais tu en connais un qui vit bien avec EasyPHP ?

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Envoyer un e-mail en localhost easyphp avec mailenable
    Par FoxLeRenard dans le forum Langage
    Réponses: 4
    Dernier message: 19/02/2009, 23h54
  2. Réponses: 135
    Dernier message: 15/12/2006, 13h56
  3. Envoyer un e-mail
    Par mouloudéen dans le forum Access
    Réponses: 1
    Dernier message: 30/10/2005, 12h05
  4. [VB.NET] Envoyer des e-mails !
    Par Ludog35 dans le forum Windows Forms
    Réponses: 11
    Dernier message: 26/10/2005, 16h50
  5. [JBOSS] Envoyer un e-mail
    Par webspeak dans le forum Wildfly/JBoss
    Réponses: 2
    Dernier message: 05/03/2005, 20h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo