Announcement

Collapse
No announcement yet.

mailtest.php error - IIS 5.0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mailtest.php error - IIS 5.0

    Hi
    I'm running Win2000 server, PHP 4.3.1, vB 2.3.0. I'm trying to get the email functionality working. I read in some of the posts that I can test my server using mailtest.php. When I run this the page I get the following:

    Address to email: box
    Send Mail button

    and
    PHP Notice: Undefined variable: address in E:\myweb.com_root\forums\mailtest.php on line 7

    when I enter an address and hit the send mail button I get the following error:

    Mail sent. Were any errors shown? If there were, mail is probably not set up correctly.

    PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for my email [email protected] in E:\myweb.com_root\forums\mailtest.php on line 17


    can someone help me out with this? I seem to remember reading a thread that said something about needing to change something in order to get the email to work properly on Win2000 IIS5 but can't seem to find it any more?

  • #2
    Try this one.

    <n/m - doesn't work>

    You may need to rename it as mailtest2.php.
    Last edited by Steve Machol; Thu 19 Jun '03, 9:30am.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      When I try and follow the link you provided I get.
      "You do not have permission to access this page."

      Comment


      • #4
        I was afraid of that. It was a file posted in the Mod forums and the attachment options won't let me upload another copy of it. Here's the text of the script. Just save it as mailtest2.php:

        Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
        <html>
        <head>
        	<title>Better Mailtest</title>
        </head>
        
        <body>
        
        <?php
        
        // ******************************************************************
        
        if (empty($_REQUEST['do']))
        {
        	$_REQUEST['do'] = 'form';
        }
        
        // ******************************************************************
        
        if ($_POST['do'] == 'mail')
        {
        	foreach($_POST as $key => $val)
        	{
        		$_POST["$key"] = trim($val);
        	}
        	
        	$host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
        	
        	echo "<p>Sending Message - Method One... ";
        	flush();
        	
        	mail($_POST['email'], $_POST['subject'] . ' (Method One)', $_POST['message']);
        	
        	echo "Done.</p>\n";
        	flush();
        	
        	echo "<p>Sending Message - Method Two... ";
        	flush();	
        	
        	mail($_POST['email'], $_POST['subject'] . ' (Method Two)', $_POST['message'], "From: \"vBulletin Mail Test\" <mailtest@$host>");
        	
        	echo "Done.</p>\n";
        	flush();
        	
        	?>
        	<p>If all goes well, the email address you specified should receive <b>two</b> email messages,
        	one with 'Method One' in the subject and the other with 'Method Two' in the subject.</p>
        	<?php
        }
        
        // ******************************************************************
        
        if ($_REQUEST['do'] == 'form')
        {
        	?>
        	<form action="mailtest2.php" method="post">
        	<input type="hidden" name="do" value="mail" />
        	<table border="1" align="center">
        	<tr>
        		<td>Mail Recipient</td>
        		<td><input type="text" name="email" size="50" /></td>
        	</tr>
        	<tr>
        		<td>Mail Subject</td>
        		<td><input type="text" name="subject" size="50" value="vBulletin Mail Test" /></td>
        	</tr>
        	<tr valign="top">
        		<td>Mail Message</td>
        		<td><textarea name="message" rows="5" cols="40">vBulletin Mail Test Message Text...</textarea></td>
        	</tr>
        	</table>
        	<p align="center"><input type="submit" value="Send Mail" /></p>
        	</form>
        	<?php
        }
        
        // ******************************************************************
        
        ?>
        
        </body>
        </html>
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          when I first load the new page I get at the bottom.

          PHP Notice: Undefined index: do in E:\clavet.ca.cargill.com_root\forums\mailtest2.php on line 21

          I'm the one managing the server so....does this need SMTP to be setup properly? As well its an intranet site so maybe its the email address format thats the problem? currently in other web forms I'm using myname/winn@winn.cgo.companyname.com and it seems to work?

          Comment


          • #6
            also when I ran the page I got the following error:

            CGI Timeout
            The specified CGI application exceeded the allowed time for processing. The server has deleted the process.


            And the system event viewer gave me

            The script started from the URL '/forums/mailtest2.php' with parameters '' has not responded within the configured timeout period. The HTTP server is terminating the script.
            For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.

            Comment


            • #7
              This does sound like server issues. Upload the phpinfo.php file from the 'extras' directory of the zip file to your forums directory. Then post the URL here.
              Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
              Change CKEditor Colors to Match Style (for 4.1.4 and above)

              Steve Machol Photography


              Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


              Comment


              • #8
                Steve can I email you a .pdf file of what the phpinfo.php page displays? This is an intranet site so I'd rather not display some of the info on this page.

                Comment


                • #9
                  No sorry. Instead you can fill out a support ticket at:



                  If you cannot grant us access to this server, then post a link to a pdf of your phpinfo output.
                  Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                  Change CKEditor Colors to Match Style (for 4.1.4 and above)

                  Steve Machol Photography


                  Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X