PDA

View Full Version : Beautify this E-Mail Script


iKwak
11-09-03, 04:24 AM
I am using this .php e-mail script for few sites but I don't like the idea of being so blank. Could anyone make add some color and simple design to it as I don't know how to work with css.

http://www.calpolyforums.com/contactus.php


<?

if (isset($_POST['from']))
{
$ip = $_SERVER['REMOTE_ADDR'];
$resolved = gethostbyaddr($ip);
if ($resolved != $ip)
{
$footer = "This e-mail was sent by a user with the IP address $ip, which resolved to '$resolved'.";
}
else
{
$footer = "This e-mail was sent by a user with the IP address $ip, which could not be resolved to a hostname.";
}
$message = $_POST['message'];
$message = "$message\n\n------------\n$footer";

if (mail('email@address.com', $subject, $message, "From: $from\r\nReply-To: $from\r\n"))
{
echo 'Your e-mail was successfully sent. Please enjoy your stay at <a href="http://www.calpolyforums.com">Cal Poly Pomona - Forum</a>';
}
else
{
echo 'There was an error while sending the mail.';
}
}
else
{
?><form method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
<p>Please be aware that your IP address (<? echo $_SERVER['REMOTE_ADDR'] ?> ) and ISP information will be sent along with the message to prevent against abuse of this mail form.</p>
<table border="0" cellspacing="0" cellpadding="3">

<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="/"><b>Forum</b></a>
Username:</font></b><br>
<i><font face="Trebuchet MS, Verdana, Tahoma, Arial, sans-serif" size="1">Leave
your name if you do not have an account.<br>
<input type="text" name="forumsusername" size="60">
</font></i></td>
</tr>
<tr>
<td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Your
E-mail Address:</font></b><i><font face="Trebuchet MS, Verdana, Tahoma, Arial, sans-serif" size="1"><br>
<input type="text" name="from" size="60">
</font></i></td>
</tr>
<tr>
<td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Subject:</font></b>
<i><font face="Trebuchet MS, Verdana, Tahoma, Arial, sans-serif" size="1"><br>
<input type="text" name="subject" size="60">
</font></i></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Message:<br>
<textarea name="message" rows="10" cols="60"></text>
</b></font></td>
</tr>
<tr>
<td align="right"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Click
"Send" once. The administrator will get back with you within 2 business days or less.</font><br>
<input type="submit" value="Send">
</td>
</tr>
</table>
</form>
<?
}


?>

Stefan
11-09-03, 11:16 AM
I'll move this to the css forums, which is probably more appropriate for this request.

iKwak
11-09-03, 06:16 PM
I'll move this to the css forums, which is probably more appropriate for this request.
:D Thanks.

Darkness22k
11-11-03, 01:48 PM
If I have time I might be able to do it, any specific colors you want?