Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: php mail help

  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php mail help

    okay, i ahve the mail script all done, and loaded, it looks fine on the page, problem is, its not sending, you click send, the page refreshes but nothing happens with the message it goes nowere. also i have a nmae field, but it also goes nowere, i dont really no what spot iwould put the name part in, a little help would be good

    PHP Code:
    <?php 
    $page 
    'http://www.maftystudios.com/services.php?sent=true';
    $to "mafty@maftystudios.com";
    $subject $_POST['contact_subject'];
    $body $_POST['contact_website'].trim("
            "
    );
    $body .= $_POST['contact_message'];
    $headers "From: " $_POST['contact_email'];
    $sent $_GET['sent'];

    if(!
    $sent && $to && $subject && $body && $headers) {
        
    $do = @mail($to$subject$body$headers);
        if( !
    $do ) {
            echo 
    'error in sending message';
        } else {
            echo 
    'message has been successfuly sent';
            echo 
    '<meta http-equiv="refresh" content="5;URL=' $page '">';
        }
    }
    ?>
    Code:
    	<form action="services.php" method="post">
            <table width="317" border="0" align="center">
              <tr> 
                <td>Name:</td>
                <td> <input name="contact_name" size="40" value="" /></td>
              </tr>
              <tr> 
                <td>E-mail:</td>
                <td> <input name="contact_email" size="40" value="" /></td>
              </tr>
              <tr>
                <td>Subject:</td>
                <td><input name="contact_subject" size="40" value="" /></td>
              </tr>
              <tr> 
                <td width="50">Website:</td>
                <td width="253"> <input name="contact_website" size="40" value="" /></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
                <td><textarea name="contact_message" cols="40" rows="9"></textarea></td>
              </tr>
              <tr> 
                <td style="text-align: center;"> </td>
                <td style="text-align: center;"> <p align="center" style="text-align: center">
                    <input type="submit" value="Submit" />
                </td>
              </tr>
            </table>
    </form>

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does it seem to get to this point?
    PHP Code:
    if( !$do ) { 
     echo 
    'error in sending message'
    } else { 
     echo 
    'message has been successfuly sent'
     echo 
    '<meta http-equiv="refresh" content="5;URL=' $page '">'

    If so, what was the outcome at that point?

    Sadiq.

  • #3
    Regular Coder
    Join Date
    Mar 2004
    Location
    Jackson, Georgia
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay, i ahve the mail script all done, and loaded, it looks fine on the page


    Do you mean you see the PHP when viewed from off the server?
    Designer's Toolz; Web & software development community.

    Get your coding questions answered:
    DTZ Forums

  • #4
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you mean you see the PHP when viewed from off the server?
    http://www.maftystudios.com/contact.php

    go there, you can see the mail script works, it jsut isnt sending the mail to my email, i have it set to send it to me but it isnt, i need to know the reason why its not sending.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •