Current location: Hot Scripts Forums » Programming Languages » PHP » script to test php mail on server - HELP


script to test php mail on server - HELP

Reply
  #1 (permalink)  
Old 07-25-07, 02:16 AM
bloodl bloodl is offline
New Member
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
script to test php mail on server - HELP

Hi

My 3 month issues is that so far I have not gotten any php mail forms to work on our server. We think we have tried everything, but we must be wrong. Are there any scripts around that I can run on the server that will just simply test if our mail works ? A script that doesn't need to be linked to external or local files ? If anyone knows of any, that would be GREAT!

I just can't figure out where the break is. When the form is filled in and completed, it never stops saying "waiting for www.mywebsite.com..." and I have never seen any error messages. Is that a clue? I am using $_POST and not $HTTP_POST_VARS, and we think we have set up the server SMPT settings correctly. The vars are coming from flash which has worked on other servers with the same php script!

I am totally confused, and frightened. I am pretty sure the problem must be to do with the server and not the script.

If anyone knows about any scripts that can test if our server is configured correctly, please show some love this way.

Cheers,
Doug
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-25-07, 05:20 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
I'm not sure this is what you want but it will run some tests for you.
http://member.dnsstuff.com/pages/dnsreport.php

And another mail server test program.
http://www.toolheap.com/

And SMTP Diagnostics.
http://www.mxtoolbox.com/diagnostic.aspx
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-25-07, 05:47 AM
darkerstar's Avatar
darkerstar darkerstar is offline
Newbie Coder
 
Join Date: Apr 2007
Location: London
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Note, PHP sendmail won't work on Windows servers if not configured correctly. You need to use a native SMTP php class to sendmail.
__________________
Read Tiaon Lab blog
PHP + Delphi programming
http://www.tiaon.com/wordpress/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-25-07, 09:41 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
When the form is filled in and completed, it never stops saying "waiting for www.mywebsite.com..."
You would need to post your code to get any help with the condition that is causing this.
Quote:
and I have never seen any error messages.
Have you checked your web server log for errors and/or is full PHP error reporting turned on?
Quote:
we think we have set up the server SMTP settings correctly.
You would need to show us what the settings are and also tell us what your SMTP setup is.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-25-07, 08:06 PM
bloodl bloodl is offline
New Member
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
code

Here is the PHP

PHP Code:

<?php 


$adminaddress 
"someone@website.com.au";
$siteaddress ="www.website.com.au";
$sitename "SiteName";

//Gets the date and time from your server
//$date = date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == ""$ip "no ip";
else 
$ip getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action $_POST['action'] ;
$firstname $_POST['firstname'] ;
$lastname $_POST['lastname'] ;
$email $_POST['email'] ;
$phone $_POST['phone'] ;
$time $_POST['time'] ;
$how $_POST['how'] ;
$promo $_POST['promo'] ;

//Process the form data!
// and send the information collected in the Flash form to Your nominated email address

if ($action == "send") {
        
//
        
mail ("$adminaddress","Website Contact",
        
"A visitor at $sitename has left the following information\n
        ------------------------------
        First Name: 
$firstname
        Last Name: 
$lastname

        Time: 
$time     
        Phone: 
$phone
        Email: 
$email
        Promo: 
$promo
        How: 
$how
       
        Logged Info :
        ------------------------------
        Using: 
$HTTP_USER_AGENT
        Hostname: 
$ip
        IP address: 
$REMOTE_ADDR
        Date/Time:  
$date","FROM:$adminaddress) ;
       
        
//This sends a confirmation to your visitor
        
mail ("$email","Thank You for visiting $sitename",
        
"Hi $firstname,
       
        Thank you for your interest in 
$sitename!
        We will get back to you as soon as possible.
       
       
        Cheers,
        
$sitename
        ------------------------------
        Phone: (02) 1234567899
        
$siteaddress","FROM:$adminaddress") ;
       
        
//Confirmation is sent back to the Flash form that the process is complete
        
$sendresult "Thank you.";
        
$send_answer "answer=";
        
$send_answer .= rawurlencode($sendresult);
        echo 
$send_answer;
//


?>
<?php
if (@mail($to$subject$message)) {
 echo(
'<p>Mail sent successfully.</p>');
} else {
 echo(
'<p>Mail could not be sent.</p>');
}
?>
and the code is sent from here in flash:


Code:
mailform = "http://www.mysite.com.au/mailform.php";
confirm = "Form Submitted.";
action = "send";
Followed by this:

Code:
loadVariablesNum(mailform, 0);
answer = confirm;
firstname = "";
lastname = "";
email = "";
phone = "";
time = "";
how = "";
promo = "";
The reason for not posting this earlier is because I have had people go over this code in the past and it didn't seem to present any problems.

Thanks for everyones help so far!!! I'm going over it with my colleague
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-25-07, 08:29 PM
bloodl bloodl is offline
New Member
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ta!

Quote:
Originally Posted by job0107 View Post
I'm not sure this is what you want but it will run some tests for you.
http://member.dnsstuff.com/pages/dnsreport.php

And another mail server test program.
http://www.toolheap.com/

And SMTP Diagnostics.
http://www.mxtoolbox.com/diagnostic.aspx
Cheers for this info, i'll surely use this in the future
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Installation, Server Administration flashweb Job Offers & Assistance 0 10-13-06 07:59 AM
Installing PHP on Windows 2003 server NoMercy PHP 2 01-07-06 11:49 PM
PHP multi-dimensional array sorting issue aqw PHP 2 06-25-05 12:09 AM
Recording Queries, Executed by PHP Script? pual_cruzs PHP 1 07-15-04 11:11 AM
Proven PHP Script not working on Windows 2000 server – any ideas? chimchim PHP 5 11-13-03 10:16 PM


All times are GMT -5. The time now is 07:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.