I've created a link that will enable the reader of any page on my
website to click it, enter an e-mail address, and have it arrive in
that inbox with a hyperlink to the site. However, I'm wondering if
there's a way to customize it further, such that the hyperlink they
are sent is the web address of the page the "send to friend" link was
on. I don't want to convert my entire site over to .asp, so having a
pop-up .asp page seems to make sense, but I want to make sure I can
achieve the functionality I seek. Thanks.
At present, here's the coding (currently configured to send the URL of
the page the code is on, not the URL of the page I want it to):
<%
SUB sendmail( fromWho, toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = Body
objCDO.Send
END SUB
fromWho = TRIM( Request.Form( "fromWho") )
toWho = TRIM( Request.Form( "toWho") )
Subject = TRIM( Request.Form( "Subject" ) )
Body = fromWho & "has sent you " &
Request.ServerVariables("SERVER_NAME") &
Request.ServerVariables("PATH_INFO")
If toWho <> "" THEN
sendMail fromWho, toWho, Subject, Body
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
Response.redirect ""
END IF
%>
<FORM METHOD="POST" ACTION="<%=Request.ServerVariables("SCRIPT_NAME")% >">
Your Friend's<br>
E-mail:<br>
<INPUT NAME="toWho" TYPE="text" SIZE=10>
<BR>Your E-mail:
<INPUT NAME="fromWho" TYPE="text" SIZE=10>
<BR>
<INPUT NAME="Subject" TYPE="hidden" value="A Feline
Friend Found this for You!" SIZE=40>
<BR><INPUT TYPE="SUBMIT" VALUE="Send Mail">
</FORM>
E 3 3294
On 12 Mar 2004 10:42:49 -0800, er**********@hotmail.com (Erik T.
Nomad) wrote: I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on.
Sure.
I don't want to convert my entire site over to .asp, so having a pop-up .asp page seems to make sense, but I want to make sure I can achieve the functionality I seek. Thanks.
At present, here's the coding (currently configured to send the URL of the page the code is on, not the URL of the page I want it to):
Simply call this sub and pass it the URL of the page, let it use that
in the link. Something like:
Link on page to send (watch for wrap, one line):
<A
HREF="http://www.sample.com/emailscript.asp?LinkURL=http://www.sample.com/thispage.htm">Send
this to a friend</A>
Modify this as:
<% SUB sendmail( fromWho, toWho, Subject, Body ) Dim objCDO Dim iConf Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mail-fwd" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPconnectiontimeout) = 10 .Update End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho objCDO.To = toWho objCDO.Subject = Subject objCDO.TextBody = Body objCDO.Send
END SUB
LinkURL = Request.QueryString(LinkUrl)
fromWho = TRIM( Request.Form( "fromWho") ) toWho = TRIM( Request.Form( "toWho") ) Subject = TRIM( Request.Form( "Subject" ) ) Body = fromWho & "has sent you " & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("PATH_INFO") If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body
Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing Response.redirect "" END IF %> <FORM METHOD="POST" ACTION="<%=Request.ServerVariables("SCRIPT_NAME")% >"> Your Friend's<br> E-mail:<br> <INPUT NAME="toWho" TYPE="text" SIZE=10> <BR>Your E-mail: <INPUT NAME="fromWho" TYPE="text" SIZE=10> <BR> <INPUT NAME="Subject" TYPE="hidden" value="A Feline Friend Found this for You!" SIZE=40>
<INPUT NAME="LinkURL" TYPE = "hidden" value = <% =LinkURL %> >
<BR><INPUT TYPE="SUBMIT" VALUE="Send Mail"> </FORM>
E
If you want the same code in all pages, you can use client-side code to
determine the url to pass in the querystring. I don't know what your method
of choice is for calling a javascript function, so I'll put it as the href
of a link.
<a href="javascript :mailMe()">Send me</a>
<script type="text/javascript">
function mailMe() { location.href='/sendpage.asp?link='+location.href; }
</script>
Ray at work
"Jeff Cochran" <jc*************@naplesgov.com> wrote in message
news:40*****************@msnews.microsoft.com... On 12 Mar 2004 10:42:49 -0800, er**********@hotmail.com (Erik T. Nomad) wrote:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on. Sure.
I don't want to convert my entire site over to .asp, so having a pop-up .asp page seems to make sense, but I want to make sure I can achieve the functionality I seek. Thanks.
At present, here's the coding (currently configured to send the URL of the page the code is on, not the URL of the page I want it to):
Simply call this sub and pass it the URL of the page, let it use that in the link. Something like:
Link on page to send (watch for wrap, one line):
<A
HREF="http://www.sample.com/emailscript.asp?LinkURL=http://www.sample.com/th
ispage.htm">Send this to a friend</A>
Modify this as:
<% SUB sendmail( fromWho, toWho, Subject, Body ) Dim objCDO Dim iConf Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mail-fwd" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPconnectiontimeout) = 10 .Update End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho objCDO.To = toWho objCDO.Subject = Subject objCDO.TextBody = Body objCDO.Send
END SUB
LinkURL = Request.QueryString(LinkUrl)
fromWho = TRIM( Request.Form( "fromWho") ) toWho = TRIM( Request.Form( "toWho") ) Subject = TRIM( Request.Form( "Subject" ) ) Body = fromWho & "has sent you " & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("PATH_INFO") If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body
Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing Response.redirect "" END IF %> <FORM METHOD="POST" ACTION="<%=Request.ServerVariables("SCRIPT_NAME")% >"> Your Friend's<br> E-mail:<br> <INPUT NAME="toWho" TYPE="text" SIZE=10> <BR>Your E-mail: <INPUT NAME="fromWho" TYPE="text" SIZE=10> <BR> <INPUT NAME="Subject" TYPE="hidden" value="A Feline Friend Found this for You!" SIZE=40>
<INPUT NAME="LinkURL" TYPE = "hidden" value = <% =LinkURL %> >
<BR><INPUT TYPE="SUBMIT" VALUE="Send Mail"> </FORM>
E
Thanks to both of you! Got it to work!
E
"Erik T. Nomad" <er**********@hotmail.com> wrote in message
news:f4**************************@posting.google.c om... I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on. I don't want to convert my entire site over to .asp, so having a pop-up .asp page seems to make sense, but I want to make sure I can achieve the functionality I seek. Thanks.
At present, here's the coding (currently configured to send the URL of the page the code is on, not the URL of the page I want it to):
<% SUB sendmail( fromWho, toWho, Subject, Body ) Dim objCDO Dim iConf Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mail-fwd" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPconnectiontimeout) = 10 .Update End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho objCDO.To = toWho objCDO.Subject = Subject objCDO.TextBody = Body objCDO.Send
END SUB fromWho = TRIM( Request.Form( "fromWho") ) toWho = TRIM( Request.Form( "toWho") ) Subject = TRIM( Request.Form( "Subject" ) ) Body = fromWho & "has sent you " & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("PATH_INFO") If toWho <> "" THEN sendMail fromWho, toWho, Subject, Body
Set ObjCDO = Nothing Set iConf = Nothing Set Flds = Nothing Response.redirect "" END IF %> <FORM METHOD="POST" ACTION="<%=Request.ServerVariables("SCRIPT_NAME")% >"> Your Friend's<br> E-mail:<br> <INPUT NAME="toWho" TYPE="text" SIZE=10> <BR>Your E-mail: <INPUT NAME="fromWho" TYPE="text" SIZE=10> <BR> <INPUT NAME="Subject" TYPE="hidden" value="A Feline Friend Found this for You!" SIZE=40> <BR><INPUT TYPE="SUBMIT" VALUE="Send Mail"> </FORM>
E This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kurda Yon |
last post by:
Sorry for a very stupid question. Can you tell me what does the
following html source does if I press button "Send"? If I read this
code by Netscaspe from my local file system and then press...
|
by: Shea Martin |
last post by:
I am trying to use a system call which takes a function ptr. My
compiler won't compile the code if I give the system_call a ptr to a
class member function, A::func(). To combat this, I created an...
|
by: Zeng |
last post by:
It's so messy w/o the "friend" relationship. Does anyone know why it was
not supported in C#. It's almost about as bad as it doesn't support the
inheritance hierarchy and method reference...
|
by: timbobd |
last post by:
I have encountered a situation that I don't understand. When I call a sub of
Friend scope (in an object with Friend scope), I am getting an error "Public
member 'subname' not found in type...
|
by: Vark |
last post by:
Interesting behavior I came across today where a child form has full access
to a base form class' controls, but you can only modify the controls'
properties in code, not in the visual designer....
|
by: AndyB |
last post by:
I'm using xsd.exe to generate a typed-dataset. Then using typed dataset
tables (datatables containing two columns--a name and a value) to bind to
ASP.NET dropdown list controls (for the dropdown...
|
by: jbeteta |
last post by:
Hello,
I have a problem declaring variables. I need to create an object oRpte
as ReportClass on WebForm1.aspx and be able to use its value on
WebForm2.aspx.
For declaring the property oRpte()...
|
by: shybe |
last post by:
Ok,
Im trying to create a "send this article to a friend" script for my
blog,
Right now its sending all the articles,
but I want it to only send the article in which the form is attached...
|
by: sj7272 |
last post by:
Hi,
I am building email marketing framework, my email templates go out to clients and I wish to include a "send to a friend" or "forward to a friend" link in the outbound email.
I want to track...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |