Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfmail question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi All,

I want the functionality like 'send this page to friend'. what tags do i need use.
if you give sample it would be much helpful.
Thanks in advance

MB
 
the tag is using CGI.server_name to extract whatever.com address and than it's using cfmail tag to send mail to whom ever you specify;

example:

<cfif isDefined(&quot;sendto&quot;)>
<cfmail
To=&quot;#sendto#&quot;
From=&quot;#from#&quot;
Subject=&quot;#Name# recommends trucks4.com&quot;>
Message from #name#: #message#

This message was sent from your #name# who visited #tellafriend_URL#. Your email address will not be distributed or sold to a third party, nor used for any other solicitation.

</cfmail>

<script language=&quot;JavaScript1.2&quot;>
alert('Email Sent');
</script>


</cfif>

<form action=&quot;&quot; method=&quot;post&quot;>
<TABLE>
<input type=&quot;hidden&quot; name=&quot;tellafriend_URL&quot; value=&quot;<CFOUTPUT>#CGI.server_name#</CFOUTPUT>&quot;>
<TR><TD colspan=&quot;2&quot;>Tell your friends about this website! Just fill in your email and name and your friend's
emails separated by commas.</TD></TR>
<TR><TD>Your Email</TD><TD><INPUT TYPE=&quot;text&quot; name=&quot;from&quot;></TD></TR>
<TR><TD>Your Name</TD><TD><INPUT TYPE=&quot;text&quot; name=&quot;name&quot;></TD></TR>
<TR><TD>Friends Emails</TD><TD><INPUT TYPE=&quot;text&quot; name=&quot;sendto&quot;></TD></TR>
<TR><TD>Your personal message</TD><TD><INPUT TYPE=&quot;text&quot; name=&quot;message&quot;></TD></TR>
<TR><TD>&nbsp;</TD><TD><INPUT TYPE=&quot;submit&quot; value=&quot;Send&quot;></TD></TR>
</TABLE>
</form> Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
you can modify tellafriend_URL form field using query_string, to set page parameters so you can send any page:

<input type=&quot;hidden&quot; name=&quot;tellafriend_URL&quot; value=&quot;<CFOUTPUT>#CGI.server_name#?#query_string#</CFOUTPUT>&quot;>
Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top