Jump to content

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: friends@liamproductions.com' . "\r\n" .
            'Reply-To: msn@liamproductions.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

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

 

Would that come to someones email like

 

From: friends@liamproductions.com

Reply to: msn@liamproductions.com

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.