Sending receiving message not working in windows server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nadun
Forum Newbie
Posts: 1
Joined: Wed Jan 06, 2010 7:18 pm

Sending receiving message not working in windows server

Post by nadun »

Hi,

I’m using a contact form which has two way communications. (Sending message to viewer and to the partner).
In linux server this form is working perfectly well. When I’ve uploaded this one into a windows server this one is not working either way. (Send or receive).I've set the php.ini to correct config as well. This particular server using a secure smtp. I’ve attached my code with this. Please someone help me out on this.

Thank you,
Nadun


Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
 
<body>
<!--PAGE CONTENTS HOLDER-->
    <div id="mainWrapper">      
        
        <div id="bodyWrapper">          
                
                    <div class="bodyContentsBottom">
                <?php
            
                    if ($_GET['mode']==1) {
                    
                    @session_start(); // start session if not started yet
                    $error = false;
                    
                    $errLog = "<div class='error_log'><div class='conatcsHolder_2'><span class='red_Txt'>Please correct following errors and re-submit</span><br/><ul>";
                    
                        
                        if ($_POST['tName']=="") {
                        $error = true;
                        $errLog .= "<li>Your name is required.</li>";
                    }
                    
                        if ($_POST['tlName']=="") {
                        $error = true;
                        $errLog .= "<li>Your last name is required.</li>";
                    }
 
                    
                        if ($_POST['tEmail']=="") {
                        $error = true;
                        $errLog .= "<li>Your email is required.</li>";
                    }
                        if ($_POST['tSubject']=="") {
                        $error = true;
                        $errLog .= "<li>Your subject is required.</li>";
                    }
                    
                        if ($_POST['tComments']=="") {
                        $error = true;
                        $errLog .= "<li>Your comment is required.</li>";
                    }
                                    
                                    
                    
                    
                    if ($error) {
                        $errLog .= "<li id='linkBack'><a href='contact_us.php?mode=0' >GO BACK</a></li></ul></div></div>";
                        echo $errLog;
                        } else {
                    
                        $body .= "Name: ".$_POST['tName']."<br/>";
                        
                        $body .= "LastName: ".$_POST['tlName']."<br/>";
                    
                        $body .= "Email: ".$_POST['tEmail']."<br/>";
                        
                        $body .= "Telephone: ".$_POST['tPhone']."<br/>";                        
 
                        $body .= "Country: ".$_POST['tCountry']."<br/>";                        
                    
                        $body .= "Subject: ".$_POST['tSubject']."<br/>";                    
                    
                        $body .= "Message: ".$_POST['tComments']."<br/>";
                    
                        
                    
                        /* send msg */
                        
                    
                        $tmpRece1 = "contact-us@returnpool.com";
                        
                        $host = "mail.xxx.com";
                        $username = "xxxx@xxxx.com";
                        $password = "xxx";
                    
                        $headers  = 'MIME-Version: 1.0' . "\r\n";
                    
                        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                    
                        $headers .= 'From:ReturnPool';
                    
                        $tmpSubject = "Contact Us Message - ReturnPool";
                    
                        
                        $bodyThankYou = "Dear Viewer,<br/><br/>";
                        $bodyThankYou .= "message<br/><br/>";
                        $bodyThankYou .= "Thanks & Regards<br/>team";   
                    
                        mail($host,$username,$password, $tmpRece1, $tmpSubject, $body, $headers);
                        mail($_POST['tEmail'],$host,$username,$password, $tmpSubject, $bodyThankYou, $headers);
                    
                        //mail($tmpRece2, $tmpSubject, $body, $headers);
                    
                        //mail($tmpRece3, $tmpSubject, $body, $headers);
                    
                        
                    
                        echo "<div class='error_log'><div class='conatcsHolder_2'><h2 class='red_Txt'>Thank you for your feedback.</h2><div class='breadScrumb'><a href='contact_us.php'>GO BACK </a>| <a href='index.php'>HOME </a></div></div></div>";
                    }
                }
                
                ?>
                
                <?php if ($_GET['mode']!=1) { ?>
                
                        <form name="myform" method="post" action="contact_us.php?mode=1" >
                        <ul id="contactUs" class="contactUsDetails bgImage">
                            <li style="padding-right:100px;">
                                <div class="contactFields">
                                    <label>First Name<span>*</span></label>
                                    <input value="<?php if($_POST['tName']!="") { echo $_POST['tName']; } ?>" type="text" name="tName" id="tName" class="commonInput" size="24" />
                                </div>
                                <div class="contactFields">
                                    <label>Last Name<span>*</span></label>
                                    <input value="<?php if($_POST['tlName']!="") { echo $_POST['tlName']; } ?>" type="text" name="tlName" id="tlName" class="commonInput" size="24" />
                                </div>
                                <div class="contactFields">
                                    <label>E-mail Address<span>*</span></label>
                                    <input value="<?php if($_POST['tEmail']!="") { echo $_POST['tEmail']; } ?>" type="text" name="tEmail" id="tEmail" class="commonInput" size="24" />
                                </div>
                                <div class="contactFields">
                                    <label>Telephone</label>
                                    <input type="text" name="tPhone" id="tPhone" class="commonInput" size="24" />
                                </div>
                                
                            </li>
                            <li>
                                <div class="contactFields">
                                    <label>Subject<span>*</span></label>
                                    <input  input value="<?php if($_POST['tSubject']!="") { echo $_POST['tSubject']; } ?>" type="text" name="tSubject" id="tSubject" class="commonInput" size="38"/>
                                </div>
                                <div class="contactFields">
                                    <label>Comments<span>*</span></label>
                                    <textarea value="<?php if($_POST['tComments']!="") { echo $_POST['tComments']; } ?>" name="tComments" id="tComments" class="commonInput" cols="40" rows="8"></textarea>
                                </div>
                                <div class="contactFields">
                                    <input type="submit" name="button" id="button" class="commonBtn" value="Send" />
                                    <input type="reset" name="reset" id="reset" class="commonBtn" value="Clear" />
                                </div>
                            </li>
                        </ul>
                        </form>
                        <?php }?>
                    </div>
        </div>
    </div>
<!--/PAGE CONTENTS HOLDER-->
</body>
</html>
Last edited by jason on Wed Jan 06, 2010 9:01 pm, edited 1 time in total.
Reason: Admin Edit: Hey! Welcome to the forums. I've taken the liberty to move your post to the proper forum, as well as setting up code tags around all that code to help people with your problem. =)
Post Reply