Not sending Mails in Live server

Page 1 of 1

1 Replies - 756 Views - Last Post: 04 March 2013 - 05:02 AM

#1 vindyauwu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 03-March 13

Not sending Mails in Live server

Posted 04 March 2013 - 04:17 AM

i am getting an error when i send mails through my live site server but in the demo server its working fine..Any solution?
This is my code
<!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">

<?php include('header.php'); ?>



      

<body id="enquery">



<div class="main">

<div class="frame_wrapper">

<div class="wrapper" id="coporate">

<div class="welcome" id="coporate">
<div class="link">

<a href="enquire.php"style="color:#FF0;">Enquiry</a>|<a href="contact.php">Contact</a>

</div>
<h1>Enquiries</h1>

<?php

include('conect_db.php');

	$intro = mysql_query("select * from intropage where id = '2'");

	$cmintro = @mysql_fetch_assoc($intro);

	$enqIntro = $cmintro['contents'];

	

	echo $enqIntro;



?>







<?php 



$to = 'vindya@cetatti.com';



if(!empty($_POST['title'])  ||

   !empty($_POST['fname']))

{





$title=$_POST['title'];

$fname=$_POST['fname'];

$lname=$_POST['lname'];

$company=$_POST['company'];

$eaddrs=$_POST['eaddrs'];

$contactno=$_POST['contactno'];

$address=$_POST['address'];

$enquiery=$_POST['enquiery'];

$message=$_POST['message'];



// validate a phone number

$msg  = "Title : $title \r\n\n";

$msg .= "FirstName : $fname \r\n\n";

$msg .= "LastName : $lname \r\n\n";

$msg .= "Company : $company \r\n\n";

$msg .= "Email: $eaddrs \r\n\n";

$msg .= "ContactNo : $contactno\r\n\n";

$msg .= "Address : $address \r\n\n";

$msg .= "Enquiery : $enquiery \r\n\n";

$msg .= "Message : $message\r\n\n";



}

?> 







<?php

						   if ($_SERVER['REQUEST_METHOD'] != 'POST'){

							  $self = $_SERVER['PHP_SELF'];

						?> 

                        

<form method='post' action='<?php echo $self;?>'>

<table class="enq" width="958" border="0">

  <tr>

    <td width="703">

    

    <table width='100%' class='inq'>

	<tr>

		<td>Title*</td>

		<td>

		<select name='title'>

		<option value=''>Please Select Title</option>

		<option value='Mr'>Mr</option>

		<option value='Mrs'>Mrs</option>

		<option value='Ms'>Ms</option>

		<option value='Mr'>Mdm</option>

		<option value='Mr'>Dr</option>

		</select>

		</td>

	</tr>

	<tr>

		<td>First Name*</td>

		<td><input type='text' name='fname' size='40'></td>

	</tr>

	<tr>

		<td>Last Name*</td>

		<td><input type='text' name='lname' size='40'></td>

	</tr>

	<tr>

		<td>Company*</td>

		<td><input type='text' name='company' size='40'></td>

	</tr>

	<tr>

		<td>Email Address*</td>

		<td><input type='text' name='eaddrs' size='40'></td>

	</tr>

	<tr>

		<td>Contact No*</td>

		<td><input type='text' name='contactno' size='40'></td>

	</tr>

	<tr>

		<td>Address</td>

		<td><input type='text' name='address' size='40'></td>

	</tr>

	<tr>

		<td>Enquiry Type*</td>

		<td>

		<select name='enquiery'>

		<option value=''>Please Select Title</option>

		<option value='General Information'>General Information</option>

		<option value='Events and Media'>Events and Media</option>

		<option value='Business opportunities'>Business opportunities</option>

		<option value='Bulk orders/wholesale'>Bulk orders/wholesale</option>

		<option value='Others'>Others</option>

		</select>

		</td>

	</tr>

	<tr>

		<td valign='top'>Message*</td>

		<td><textarea name='message' cols='31' rows='5'></textarea></td>

	</tr>

	<tr>

		<td valign='top'>&nbsp;</td>

		<td><input type='submit' name='submit1' class='submit1' value='Submit'></td>

	</tr>

</table>

    

    

    	</tr>

</table>



</form>



							<?php 	} else {

									error_reporting(0);

							

									if  (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))

									echo nl2br("

									<ul class=\"MsgSent\">

										<h4>Congratulations!!</h4>

										<p>Thank you, your message is sent!<br /> We will get back to you as soon as possible.</p>

									</ul>

								   ");

							

									else

									echo "

									<ul class=\"MsgError\">

										<h1>Error!!</h1>

										<p>Sorry, your message failed to send. Try later!</p>

							</ul>";

								}  

							?>



</div>





</div>

</div>



 <?php include('nav1.php'); ?> 

</div>



<?php include('footer.php'); ?>



</body>

</html>





Is This A Good Question/Topic? 0
  • +

Replies To: Not sending Mails in Live server

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: Not sending Mails in Live server

Posted 04 March 2013 - 05:02 AM

Closed as duplicate. Do not cross-post or create duplicate topics.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1