Visualizzazione dei risultati da 1 a 4 su 4

Discussione: problema formail

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    112

    problema formail

    ciao a tutti io tramite un libro di php ho creato un formail però ora ho un problema avendo il server di prova apache vorrei provare questo form ma mi da questo messaggio di errore:

    html>
    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 C:\Programmi\Apache Group\Apache2\htdocs\sendmail.php on line 14
    there was an error....


    il codice delle pagine php è sendmail

    >html>
    <head>
    <title>Mail Sent</title>
    </head>
    <body>
    <?php
    $to = $_POST["info@wesolutionportal.it"];
    $to = $_POST["from"];
    $to = $_POST["subject"];
    $to = $_POST["message"];
    $headers = "from: " . $frum . "\r\n";
    $mailent = mail($to, $subject, $message, $headers);
    if ($mailent) {
    echo "Congrats: the following message has been sent:

    ";
    echo "To: $to
    ";
    echo "From: $from
    ";
    echo "subject:
    ";
    echo $message;
    } else {
    echo "there was an error....";
    }
    ?>
    </body>
    </html>

    nell'altro postcard dove viene scritto il messaggio

    <html
    <head>
    <title>Enter E-mail Data </title>title>
    </head>
    <body>
    <form name="theform" method="post" action="sendmail.php">
    <table>
    <tr>
    <td>To</td>
    <td><input type="text" name="to" size="50"></td>
    </tr>
    <tr>
    <td>From:</td>
    <td><input type="text" name="from" size="50"></td>
    </tr>
    <tr>
    <td>subjact:</td>
    <td><input type="text" name="subjact" size="50"></td>
    </tr>
    <tr>
    <td valign="top">Message:</tr>
    <td>
    <textarea cols="60" rows="10" name="message"
    >enter your message here</textarea></td>
    </tr>
    <tr>
    <td></td>
    <td>
    <input type="submit" value="send">
    <input type="reset" value="reset the form">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    si puo risolvere questo problema?

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    sì, ti bastava fare una ricerca visto che ci saranno un milione di posts sullo stesso problema. L'errore spiega tutto: non hai un server di posta (SMTP) installato dove gli dici di andarlo a cercare (in localhost). Senza andare ad installare altre cose, apri php.ini, vai alle righe incriminate e come server di posta ci metti il server di posta (SMTP) di default che ti danno con la tua connessione internet e la relativa porta. Tutto questo se stai su windows (e a giudicare dai percorsi direi di sì).
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  3. #3
    Utente bannato L'avatar di Skyline89
    Registrato dal
    Jun 2006
    Messaggi
    225
    si.... emualre un SMTP o usare un programma con SMTP integrato... oppure farlo sul server...

  4. #4
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    112
    nel file php.ini le righe che ho trovato sono queste

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    ;sendmail_from = me@example.com- questa deve essere cambiata con info@websolutioportal.it

    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =

    il file conf di apche

    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. admin@your-domain.com

    ServerAdmin info@websolutionportal.it.del mio server ha come

    ServerName www.websolutionportal.it:80

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.