Jump to content

Does this mail function work


LiamProductions

Recommended Posts

Hey,

 

I was wondering if these two codes actually work reason i can't test my self is because i don't have STMP server or whatever on my localhost and my web host is down  >:(

 

Heres both codes:

 

friends.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Liam">

<title>Liams friends message</title>
</head>

<body>
<table border="0">
<tr>
<form method="post" action="success.php">
<td><b>To:</td></b><td><input type="text" name="to"></td>
<tr />
<tr>
<td>
<b>From: </b></td><td><input type="text" name="from"></td>
</tr>
<tr>
<td><center></center><input type="submit" value="Invite Friend!"></center></td></tr></table>
</form>

</body>
</html>

 

AND...

 

success.php:

<?php

extract($_POST);
echo "Your invite has been sent to $to";
$subject = "Your friend has invited you!";
$message = "Your friend $from has invited you to join http://www.liamproductions.com Click the link to go there now!";
$headers = 'From: [email protected]' . "\r\n" .
            'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

 

Would that come to someones email like

 

From: [email protected]

Reply to: [email protected]

Subject: Your friend has invited you!

Message: Your friend [FROM FIELD ON FIRST PAGE] has invited you to join http://www.liamproductions.com Click the link to go there now!

 

Would it?

Link to comment
https://forums.phpfreaks.com/topic/64437-does-this-mail-function-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.