tolearn Posted November 17, 2007 Share Posted November 17, 2007 Hi Im working with a website. Im using the mail sending option in php. I tried to send mail to my id but im not getting the mail. wat may the problem. Code: <table width="100%" height="100%" border="0"> <tr> <td height="153" align=left valign="top"><table width="831" border="0"> <tr> <td width="768" height="144" align="left" valign="top" ><font size="+2" face="Arial, Helvetica, sans-serif"><strong> <font color="#FF9900">Welcome to the Online Consultancy Service</font></strong></font> <table width="570" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="661" align="left" bgcolor="#FFFFFF">Have your trade or tax related question answered by experts in the field.</td> </tr> <!-- for a nominal fee of INR: <'formatnumber(gc_online_consultancy_service_fee, 2)%>--> <tr> <td align="left" bgcolor="#FFFFFF"> <font color="#FF9900" size="+2" face="Arial, Helvetica, sans-serif"></font> The answer to your question will be emailed to the mail id provided in the form below.</td> </tr> <tr> <td></td> </tr> <tr> <td align="left" bgcolor="#FFFFFF">If you have any questions about this service, please email us at <a href="mailto:contact@agol.in">contact@agol.in</a> for details.</td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td height="451"><table width="98%" height="100%" border="0"> <?php if(isset($_POST['fd'])) { ?> <tr bordercolor="#990000"> <td align="left" valign="top"> <div align="center"> <? //ob_start(); //$to = 'contact@agol.in'; $to = "preetha_chandru@rediffmail.com"; $cust_name=$_REQUEST['txtname']; $cust_email=$_REQUEST['txtemail']; $subject=$_REQUEST['txtsubject']; $Query=$_POST['txtquery']; //$body="Name: ".$cust_name."\n"."Email: ".$cust_email."\n"; //$body=$body."Query: \n".$_POST['txtquery']; $body=' <table width="68%" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="30%"> </td> <td width="70%"> </td> </tr> <tr> <td>Name</td> <td>'. $cust_name .'</td> </tr> <tr> <td>Email Id</td> <td>'. $cust_email . '</td> </tr> <tr> <td>Subject</td> <td>' . $subject. '</td> </tr> <tr> <td>Query</td> <td>' .$Query .'</td> </tr> </table>'; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To:www.agol.in <contact@agol.in>' . "\r\n"; $headers .= 'From: <'. $cust_email .'>' . "\r\n"; if(mail($to, $subject, $body, $headers)) { echo "Mail has been sent."; } else { echo "Mail Not sent. Try Again."; } ?> </div></td> </tr> <? } ?> <tr> <td width="86%" align="left" valign="top"><fieldset> <legend><strong><font color="#CC0000" size="+1">Online Consultancy</font></strong></legend> <form id="form1" name="form1" method="post" action="onlineconsultancy.php"> <table width="514" height="120" border="0"> <tr> <td width="171">Name:</td> <td width="327"><input name="txtname" type="text" /></td> </tr> <tr> <td>Email Id:</td> <td><input name="txtemail" type="text" /></td> </tr> <tr> <td>Subject:</td> <td><input name="txtsubject" type="text" /></td> </tr> <tr> <td valign="top">Query:</td> <td><p> <textarea name="txtquery" cols="50" w="w" rows="10"></textarea> </p></td> </tr> <tr> <td valign="top"> </td> <td> </td> </tr> <tr> <td valign="top"><input name="fd" type="hidden" id="fd" value="fd" /></td> <td><input type="submit" name="Submit" value="Submit" /></td> </tr> <tr></tr> </table> </form> <p> </p> <p> </p> <p> </p> </fieldset></td> </tr> </table></td> </table> Thank you Quote Link to comment Share on other sites More sharing options...
0x00 Posted November 17, 2007 Share Posted November 17, 2007 For some reason there's code tags in forums... (they look like '#') P.S. When debugging, build your form, then when you receive the data print it out, then send it. This way you'll know at which point the problem is occurring! Quote Link to comment Share on other sites More sharing options...
tolearn Posted November 19, 2007 Author Share Posted November 19, 2007 Hi I tried by printing also. Everything goes fine. Control goes into the if loop also and im getting the text "Mail has been sent printed". But im not getting the mails. Thank you Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 19, 2007 Share Posted November 19, 2007 Check your spam/bulk folder, it might be there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.