...

View Full Version : php mail help



Mafty
03-30-2004, 12:13 AM
okay, i ahve the mail script all done, and loaded, it looks fine on the page, problem is, its not sending, you click send, the page refreshes but nothing happens with the message it goes nowere. also i have a nmae field, but it also goes nowere, i dont really no what spot iwould put the name part in, a little help would be good :)


<?php
$page = 'http://www.maftystudios.com/services.php?sent=true';
$to = "mafty@maftystudios.com";
$subject = $_POST['contact_subject'];
$body = $_POST['contact_website'].trim("
");
$body .= $_POST['contact_message'];
$headers = "From: " . $_POST['contact_email'];
$sent = $_GET['sent'];

if(!$sent && $to && $subject && $body && $headers) {
$do = @mail($to, $subject, $body, $headers);
if( !$do ) {
echo 'error in sending message';
} else {
echo 'message has been successfuly sent';
echo '<meta http-equiv="refresh" content="5;URL=' . $page . '">';
}
}
?>



<form action="services.php" method="post">
<table width="317" border="0" align="center">
<tr>
<td>Name:</td>
<td> <input name="contact_name" size="40" value="" /></td>
</tr>
<tr>
<td>E-mail:</td>
<td> <input name="contact_email" size="40" value="" /></td>
</tr>
<tr>
<td>Subject:</td>
<td><input name="contact_subject" size="40" value="" /></td>
</tr>
<tr>
<td width="50">Website:</td>
<td width="253"> <input name="contact_website" size="40" value="" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><textarea name="contact_message" cols="40" rows="9"></textarea></td>
</tr>
<tr>
<td style="text-align: center;"> </td>
<td style="text-align: center;"> <p align="center" style="text-align: center">
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>

sad69
03-30-2004, 01:19 AM
Does it seem to get to this point?


if( !$do ) {
echo 'error in sending message';
} else {
echo 'message has been successfuly sent';
echo '<meta http-equiv="refresh" content="5;URL=' . $page . '">';
}


If so, what was the outcome at that point?

Sadiq.

DesignersToolz
03-30-2004, 01:41 AM
okay, i ahve the mail script all done, and loaded, it looks fine on the page




Do you mean you see the PHP when viewed from off the server? :confused:

Mafty
03-30-2004, 02:57 AM
Do you mean you see the PHP when viewed from off the server?

http://www.maftystudios.com/contact.php

go there, you can see the mail script works, it jsut isnt sending the mail to my email, i have it set to send it to me but it isnt, i need to know the reason why its not sending.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum