www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

    Reply
     
    Thread Tools Search this Thread Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
      #1  
    Old 02-06-2004, 08:06 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    PHP Mail script giving error message

    I want to use a php mailing script, but even though i used a tutorial to make mine, it doesn't work. Here is the page that it's being used on: http://projep.t35.com/a.php?a=contact and i have no idea what part of the script doesn't work but it's really short, so I'll do the whole thing:
    PHP Code:
    <?
    $name
    =$_POST['name'];
    $email=$_POST['contact'];
    $comments=$_POST['content'];
    $to="otacon2662@yahoo.com";
    $message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
    mail($to,"Comments From Your Site",$message,"From: $email\n");
    if(
    mail($to,"Comments From Your Site",$message,"From: $email\n")) {
    echo
    "Thanks for your comments. Click elsewhere on the page to get to the good stuff.";
    } else {
    echo
    "There was a problem sending the mail. Please go back to the <a href=http://projep.t35.com/a.php?a=contact> and check that you filled in the form correctly.";
    }
    ?>
    Reply With Quote
      #2  
    Old 02-06-2004, 08:59 PM
    Sam Sam is offline
    Registered User
     
    Join Date: Aug 2003
    Posts: 1,632
    you're not recieving these emails, correct?
    Reply With Quote
      #3  
    Old 02-06-2004, 09:09 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    Correct

    if i were then the mailing script wouldve worked succesfully, and i would be able to hammer out any remaining bugs myself, but as it stands, me being a php n00b, i need help from the ppl who know what they're doing..
    Reply With Quote
      #4  
    Old 02-06-2004, 11:13 PM
    PunkSktBrdr01's Avatar
    PunkSktBrdr01 PunkSktBrdr01 is offline
    oh, that kid...!
     
    Join Date: May 2003
    Location: Millis, MA
    Posts: 455
    Is PHP in safe mode on your server?
    __________________
    isn't this profound...
    http://www.radioactiverabbit.com
    Reply With Quote
      #5  
    Old 02-07-2004, 02:33 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    i don't know. I use a free webserver and have never heard of safe mode, but im also a php n00b so... :-\
    Reply With Quote
      #6  
    Old 02-07-2004, 05:15 PM
    PunkSktBrdr01's Avatar
    PunkSktBrdr01 PunkSktBrdr01 is offline
    oh, that kid...!
     
    Join Date: May 2003
    Location: Millis, MA
    Posts: 455
    Okay, make a file that looks exactly like this and upload it to the server:

    phpinfo.php
    PHP Code:
    <html>
    <head>
        <title>PHP Info</title>
    </head>
    <body>
        <?php phpinfo(); ?>
    </body>
    </html>
    Go to this page in a browser. It give you all of the PHP configuration information. Under "PHP Core", find the 'safe_mode' directive.

    If safe mode is on, it might be the cause of your problem. Safe mode can prevent you from sending mail to any domain other than your own.
    __________________
    isn't this profound...
    http://www.radioactiverabbit.com
    Reply With Quote
      #7  
    Old 02-07-2004, 07:20 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    Yep, it's on. Any workarounds, or ways to turn it off?

    http://projep.t35.com/phpinfo.php if you're interested by the way.
    Reply With Quote
      #8  
    Old 02-07-2004, 08:24 PM
    Vasilli Vasilli is offline
    Registered User
     
    Join Date: Jun 2003
    Location: Brisbane, Australia
    Posts: 53
    I am not too sure that this will make a HUGE if any difference but i would try it anyways

    PHP Code:

    <?
    $name
    = $HTTP_POST_VARS['name'];
    $email = $HTTP_POST_VARS['contact'];
    $comments=$HTTP_POST_VARS['content'];
    $to="otacon2662@yahoo.com";
    $message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";

    if (
    $name != NULL){

    $sendNow = mail($to,"Comments From Your Site",$message,"From: $email\n");
    }
    if(
    $sendNow){
    echo
    "Thanks for your comments. Click elsewhere on the page to get to the good stuff.";
    }
    else {
    echo
    "There was a problem sending the mail. Please go back to the <a href=http://projep.t35.com/a.php?a=contact> and check that you filled in the form correctly.";
    }
    ?>
    ** Untested **

    again i will say i don't know that this will fix the problem, however being a free host you never know!

    Good luck

    Jono
    Reply With Quote
      #9  
    Old 02-07-2004, 09:36 PM
    PunkSktBrdr01's Avatar
    PunkSktBrdr01 PunkSktBrdr01 is offline
    oh, that kid...!
     
    Join Date: May 2003
    Location: Millis, MA
    Posts: 455
    Quote:
    Any workarounds, or ways to turn it off?
    Unfortunately, no. You can try asking the host to turn safe mode off, but that probably won't work.
    __________________
    isn't this profound...
    http://www.radioactiverabbit.com
    Reply With Quote
      #10  
    Old 02-07-2004, 10:05 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    nah, didn't work.

    does this mean i'm doomed to use response-o-matic until i pay for my web server??
    Reply With Quote
      #11  
    Old 02-08-2004, 11:38 AM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    i emailed the webmaster with the request, but s/he hasnt replied
    Reply With Quote
      #12  
    Old 02-08-2004, 02:06 PM
    PunkSktBrdr01's Avatar
    PunkSktBrdr01 PunkSktBrdr01 is offline
    oh, that kid...!
     
    Join Date: May 2003
    Location: Millis, MA
    Posts: 455
    It looks like you'll need to find a new host.
    __________________
    isn't this profound...
    http://www.radioactiverabbit.com
    Reply With Quote
      #13  
    Old 02-08-2004, 02:53 PM
    Ben Rogers Ben Rogers is offline
    Registered User
     
    Join Date: Jan 2004
    Posts: 2,939
    Or.. I could just keep using response-o-matic, or just give a link to my email adress.... I like this host, just because I have to use a host for a mailing script doesn't mean I have to change.
    Reply With Quote
      #14  
    Old 02-08-2004, 02:56 PM
    96turnerri's Avatar
    96turnerri 96turnerri is offline
    L.A.M.P.
     
    Join Date: Sep 2003
    Location: Portsmouth, UK Occupation: Web Developer
    Posts: 2,658
    i have t35 hosting and it **** well actually not THAT bad, mail() doesnt work and upload is like 2kbps, considering i have a 1024/512 connection that sucks. They are the only things i have FOUND thats wrong im sure theres more,

    o yeah how could i 4get the ads, ebay and the others try to install crap on my pc so i have to view it in opera which blocks these nasty ads.
    __________________
    Richard Turner - A Virtual Insight
    Reply With Quote
      #15  
    Old 02-08-2004, 03:00 PM
    Conor's Avatar
    Conor Conor is offline
    Complex Fellow
     
    Join Date: Nov 2003
    Location: Long Island
    Posts: 922
    try thrillinghill.com for a host. very reliable
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 11:43 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.