...

View Full Version : Email problem.



saeed
07-25-2007, 12:49 PM
I download the following script from some website. did some alterations. I want a contact us form on my website. Everything seems fine but am not receiving any email. :(

am not at php coder at all.
Kindly have a look at the code below and tell me where am going wrong ...

Additionally, I've got index.php some text and i've include contactus_a01.php

thanks,

Saeed.

ssconfig.php

$to="saeednagaria@gmail.com";
$contact_us_text="Contact Form";
$your_text=".";
$sent_message="Your message has been sent!";
$small_text="(fill in the fields and press submit)";
$contact_page="index.php";

contactus_a01.php

<?
include 'ssconfig.php';
$h='http://www.';$r='reconn.us';
$text_string="<b>".$contact_us_text."</b> ".$your_text;
$subject=$_POST['nume']." completed the contact us form!";
$k='class';$k1='ifieds';$k2=' php';
if($_SERVER['REQUEST_METHOD']=='POST')
{
$msg="Contact us form completed:\n";
$msg.="1. Name :".$_POST['nume']."\n";
$msg.="2. E-mail:".$_POST['email']."\n";
$msg.="3. Web:".$_POST['website']."\n";
$msg.="3. Message:". $_POST['mesaj']."\n";
mail( $to, $subject, $msg,"From:".$_POST['nume']." <".$_POST['email'].">\nX-Sender: <".$_POST['email'].">\nX-Priority: 1\nReturn-Path: <".$_POST['email'].">\nContent-Type: text/html; charset=iso-8859-1\n" );
echo '<table border= "0" cellpadding = "0" cellspacing="0" width="400" class="contact_us"><tr><td><div align=center class="contact"><table align=center><tr><td height=280>';
echo '<p class="sent_message">'.$sent_message.'</p></td></tr></table></div></td></tr></table>';
}
else
{
?>
<table width="400" class="contact_us" cellpadding="0" cellspacing="0"><tr><td><div class="contact">
<?php echo $text_string ?><br><font size="1" face="Geneva, Arial, Helvetica, sans-serif">

<?php echo $small_text ?></font><br><br>
<form name="form1" method="post" action= <?php echo basename($PHP_SELF); ?> >
<table width=100% cellspacing="0" class="form_fonts">
<tr>
<td>Your Name</td>
<td><input name="nume" type="text" id="nume" size="40" maxlength="255" class="inputs" onfocus="this.className='inputs-focus';" onblur="this.className='inputs';"></td>
</tr>
<tr>
<td>Your E-mail</td>
<td><input name="email" type="text" id="email" size="40" maxlength="255" class="inputs" onfocus="this.className='inputs-focus';" onblur="this.className='inputs';"></td>
</tr>
<tr>
<td>Your Website</td>
<td><input name="website" type="text" id="website" size="40" maxlength="255" class="inputs" onfocus="this.className='inputs-focus';" onblur="this.className='inputs';"></td>
</tr>
<tr>
<td valign="top"><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Comments</font></font></td>
<td>
<textarea name="mesaj" cols="37" rows="5" id="mesaj" class="inputs" onfocus="this.className='inputs-focus';" onblur="this.className='inputs';"></textarea></td>
</tr>
</table>
<p align="center">
<input name="Submit" type="image" src="submit_a01.gif" border="0" value="Submit">
<input type="image" src="reset_a01.gif" name="Submit2" value="Reset" onclick="this.form.reset();return false;">
</p>
<DIV style="BORDER-TOP: 0px; OVERFLOW-Y: scroll; OVERFLOW-X: hidden; OVERFLOW: scroll; BORDER-LEFT: 1px; WIDTH: 100%; SCROLLBAR-ARROW-COLOR: #003366; BORDER-BOTTOM: 1px; BORDER-RIGHT-STYLE: none; SCROLLBAR-BASE-COLOR: #aebed8; HEIGHT: 1px">
<?php
$l=$h.$r;
echo '<a href="'.$l.'">'.$k.$k1.$k2.'</a>'.$l;
?>
</DIV>
</form>
</div></td></tr></table>
<?
}
?>

_Aerospace_Eng_
07-25-2007, 01:25 PM
What webhost are you trying this on?

saeed
07-25-2007, 02:21 PM
at the moment ... am using www.freehostia.com

saeed
07-25-2007, 02:37 PM
thts strange ... I upload all the files to another server and its working alrite.


donno whts wrong with this web host. :rolleyes:

GO ILLINI
07-25-2007, 07:53 PM
The webhost may not support all the options in the 'headers' section of the main() function. Also the host may have some rule such as 'The mail must be sent from a certain email address.' As it is a free host support will be limited, but if you contact them, they might be able to help you.

_Aerospace_Eng_
07-25-2007, 09:42 PM
Freehostia's free hosting account disables any outgoing mail connections hence why its not working meaning no mail() function or no sendmail function either will work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum