Creating a Simple Email Form in PHP Support Product Page

This topic was archived

Developing Further..

Asked 18 Oct 2003 15:19:26
1
has this question
18 Oct 2003 15:19:26 Martin Howell posted:
<font face='Arial'></font id='Arial'><font size=2></font id=size2>Hi, I've worked through the tutorial and have set up my form successfully. <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

<b>Two questions:</b>

<b>1.)</b> I was wondering how you could expand on the email that is sent i.e. specify font, colour and put information into a table. Can this be done?

<b>2.)</b> The date format seems to in Eastern Time (GMT -5hrs). How can you set it to GMT? I've looked on the www.php.net site but couldn't find anything suitable.

Any idea's?

Chees,
Martin <img src=../images/dmxzone/forum/icon_smile_question.gif border=0 align=middle>

Replies

Replied 18 Oct 2003 17:22:06
18 Oct 2003 17:22:06 Gareth Downes-Powell replied:
1)

You can send emails as HTML, you just need to add extra headers to the email eg

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset = iso-8859-1\r\n";

You can then embed HTML tags in your email to style the output.

Be aware though that a lot of people have their email programs set not to display HTML.

2)

When you use the date command, it gives the time on the server.

Probably the easiest thing would be to create a timestamp using the PHP mktime() function of the current date and time. You can then -5 hours using the PHP strtotime() function and display the new time with the PHP date() function eg

&lt;?php
$timestamp = mktime(date("G",date("i",date("s",date("m",date("d",date("Y");
$newTimestamp = strtotime("-5 hours",$timestamp);
$newTime = date("G:i",$newTimestamp);
echo "Time: " . $newTime;
?&gt;

Gareth

Reply to this topic