Forums
This topic is locked
Mailto form
Posted 25 May 2003 03:54:20
1
has voted
25 May 2003 03:54:20 Marc Fogel posted:
I want to create a from on my site but not quite sure how to go about it. I would have four fields.User Name:
User E-mail Address:
Friends Name:
Friend's E-mail Address:
When the user hits submit and e-mail is sent to the Friend's E-mail Address and is from the User. I would also want the reply to address to be to another address not the User.
Can this be done?
Thanks
Marc
Replies
Replied 25 May 2003 23:22:24
25 May 2003 23:22:24 james crellin replied:
I was going to find a script and explain it but there is so many and i dont quit have the time at the moment. Let me know if you need help later.
Here is a site that has a lot of them for free
www.hotscripts.com/PHP/Scripts_and_Programs/Site_Recommendation/index.html
<img src="syndicprint.com/o_chacon/jtc_sig.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz
Here is a site that has a lot of them for free
www.hotscripts.com/PHP/Scripts_and_Programs/Site_Recommendation/index.html
<img src="syndicprint.com/o_chacon/jtc_sig.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz
Replied 26 May 2003 00:35:12
26 May 2003 00:35:12 james crellin replied:
I changed this code so that it will use the "your email" as the reply email address. Paste all the code into a PHP document and name it index.php
I hope that it works for what you want.
=============================================
<?php
## Start Config ##
$sitename = "Your Site Name";
$siteurl = "www.yourdomain.com";
$adminemail = "$email1"; // when the emailer enters their address the replay will be sent here
$emailsubject = "enter the message that gets sent to the receiver here";
$keywords = ""; // site keywords
$des = ""; // description of site
$textcolor = "000000";
$color1 = "#EAE3FD";
$color2 = "#DBE7FD";
$color3 = "#FEF3ED";
$footer = "header code";
$header = "footer code";
## Put your message here between "" marks ##
$msg = "put your email message here my message";
######### END CONFIG ####################
if ($submit){
// if email #1 and email #2 are empty, display error //
if ($email1 == "" || $email2 == ""
{
echo "<font size=3 face=Arial><B>ERROR!!</b></font><font size='2' face='arial'>Either <b>yourname</b>, <b>friends name</b>, <b>your email</b> or your <b>friends email</b> was left out, please go back and fill in the entire form. Thank you!</font>";exit;}
// Start Message to friend
$message = "This message is from your friend : $email1
----------
$msg
";
mail("$email2","$emailsubject", $message, "From:$sitename <$adminemail>"
;
mail("$email3","$emailsubject", $message, "From:$sitename <$adminemail>"
;
mail("$email4","$emailsubject", $message, "From:$sitename <$adminemail>"
;
mail("$email5","$emailsubject", $message, "From:$sitename <$adminemail>"
;
?>
<!-- Start Thank you -->
<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<TABLE WIDTH="37%" ALIGN="CENTER">
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Your Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email1?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email2?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email3?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email4?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email5?></FONT></TD>
</TR>
</TABLE>
<font face="Arial" size="2"></form><br></font></div><div align="center">
<br></div>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><hr size="2"></td>
</tr>
</table>
<!-- End Thank you -->
<?php
}
## END OF SUBMIT ##
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> <?=$sitename?> </TITLE>
<META NAME="Keywords" CONTENT="<?=$keywords?>">
<META NAME="Description" CONTENT="<?=$des?>">
</HEAD>
<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$header?></td>
</tr>
</table>
<form action="<?=$PHP_SELF?>" method="post">
<table width="600" align="center">
<tr>
<td width="50%" bgcolor="<?=$color2?>"> <div align="right"><font size="2" face="Arial"><b>Your Email</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"> <input type="text" name="email1" maxlength="100"></td>
</tr>
<tr>
<td width="50%" bgcolor="<?=$color2?>"><div align="right"><font size="2" face="Arial"><b>Friends Email 1</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"><input type="text" name="email2" maxlength="100"></td>
</tr>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 2</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"> <INPUT TYPE="text" NAME="email3" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 3</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email4" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 4</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email5" MAXLENGTH="100"> </TD>
</TR>
<tr>
<td width="50%"> </td><td width="50%"><input type="submit" name="submit" value="SUBMIT"></td>
</tr>
</table>
</form>
<!-- Do not remove this copyright notice -->
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td><div align="center"><font face="verdana" size="1"><b>Powered by</b>: <a href="www.boxxnet.com">Tell-A-Friend ND</a>
Version 1.0<br> Copyright ©2002, BoxxNet Limited.</font></div></td>
</tr>
</table>
<!-- Do not remove this copyright notice -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$footer?></td>
</tr>
</table>
</body>
</html>
<img src="syndicprint.com/o_chacon/jtc_sig.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz
Edited by - saleblitz on 26 May 2003 00:36:30
I hope that it works for what you want.
=============================================
<?php
## Start Config ##
$sitename = "Your Site Name";
$siteurl = "www.yourdomain.com";
$adminemail = "$email1"; // when the emailer enters their address the replay will be sent here
$emailsubject = "enter the message that gets sent to the receiver here";
$keywords = ""; // site keywords
$des = ""; // description of site
$textcolor = "000000";
$color1 = "#EAE3FD";
$color2 = "#DBE7FD";
$color3 = "#FEF3ED";
$footer = "header code";
$header = "footer code";
## Put your message here between "" marks ##
$msg = "put your email message here my message";
######### END CONFIG ####################
if ($submit){
// if email #1 and email #2 are empty, display error //
if ($email1 == "" || $email2 == ""

echo "<font size=3 face=Arial><B>ERROR!!</b></font><font size='2' face='arial'>Either <b>yourname</b>, <b>friends name</b>, <b>your email</b> or your <b>friends email</b> was left out, please go back and fill in the entire form. Thank you!</font>";exit;}
// Start Message to friend
$message = "This message is from your friend : $email1
----------
$msg
";
mail("$email2","$emailsubject", $message, "From:$sitename <$adminemail>"

mail("$email3","$emailsubject", $message, "From:$sitename <$adminemail>"

mail("$email4","$emailsubject", $message, "From:$sitename <$adminemail>"

mail("$email5","$emailsubject", $message, "From:$sitename <$adminemail>"

?>
<!-- Start Thank you -->
<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<TABLE WIDTH="37%" ALIGN="CENTER">
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Your Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email1?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email2?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email3?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email4?></FONT></TD>
</TR>
<TR>
<TD WIDTH="45%"><DIV ALIGN="CENTER"><FONT SIZE="2" FACE="Arial"><B>Friends Email:</B></FONT></DIV></TD>
<TD WIDTH="55%"><FONT FACE="Arial" SIZE="2"><?=$email5?></FONT></TD>
</TR>
</TABLE>
<font face="Arial" size="2"></form><br></font></div><div align="center">
<br></div>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><hr size="2"></td>
</tr>
</table>
<!-- End Thank you -->
<?php
}
## END OF SUBMIT ##
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> <?=$sitename?> </TITLE>
<META NAME="Keywords" CONTENT="<?=$keywords?>">
<META NAME="Description" CONTENT="<?=$des?>">
</HEAD>
<body bgcolor="<?=$color3?>" text="<?=$textcolor?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$header?></td>
</tr>
</table>
<form action="<?=$PHP_SELF?>" method="post">
<table width="600" align="center">
<tr>
<td width="50%" bgcolor="<?=$color2?>"> <div align="right"><font size="2" face="Arial"><b>Your Email</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"> <input type="text" name="email1" maxlength="100"></td>
</tr>
<tr>
<td width="50%" bgcolor="<?=$color2?>"><div align="right"><font size="2" face="Arial"><b>Friends Email 1</b></font></div></td>
<td width="50%" bgcolor="<?=$color2?>"><input type="text" name="email2" maxlength="100"></td>
</tr>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 2</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"> <INPUT TYPE="text" NAME="email3" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 3</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email4" MAXLENGTH="100"></TD>
</TR>
<TR>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><DIV ALIGN="right"><FONT SIZE="2" FACE="Arial"><B>Friends Email 4</B></FONT></DIV></TD>
<TD WIDTH="50%" BGCOLOR="<?=$color2?>"><INPUT TYPE="text" NAME="email5" MAXLENGTH="100"> </TD>
</TR>
<tr>
<td width="50%"> </td><td width="50%"><input type="submit" name="submit" value="SUBMIT"></td>
</tr>
</table>
</form>
<!-- Do not remove this copyright notice -->
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td><div align="center"><font face="verdana" size="1"><b>Powered by</b>: <a href="www.boxxnet.com">Tell-A-Friend ND</a>
Version 1.0<br> Copyright ©2002, BoxxNet Limited.</font></div></td>
</tr>
</table>
<!-- Do not remove this copyright notice -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$footer?></td>
</tr>
</table>
</body>
</html>
<img src="syndicprint.com/o_chacon/jtc_sig.gif" border=0>
<b>"I learn so I can help."</b> =- Saleblitz
Edited by - saleblitz on 26 May 2003 00:36:30
Replied 26 May 2003 01:15:16
26 May 2003 01:15:16 Marc Fogel replied:
Thanks.
Huge Help <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Huge Help <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>