Avatar billede muffy Nybegynder
18. november 2001 - 20:11 Der er 3 kommentarer og
1 løsning

Send link

<html>
<body bgcolor=\"#FFFFFF\">
<title>Mail-A-Link</title>
<% \' Grab the title and referring page
title=trim(request.querystring(\"title\"))
referer=request.servervariables(\"http_referer\")
if title = \"\" then
title=trim(request.form(\"title\"))
end if
u_submitted=trim(request.form(\"u_submitted\"))
\' u_submitted checks to see if the form with an email address was submitted
if referer = \"\" then
\' If there is no referring page display an appropriate message
response.write \"You have reached the Mail-A-Link page, but we were unable to recognize the previous page\"
response.end
end if \' End check for referer
\' If the form with the email address has benn submittes send the mail
if u_submitted <> \"Yes\" then
%>
<form action=\"<%= request.servervariables(\"script_name\") %>\" method=\"post\">
<b>Subject:</b> <%= title %>
<br>
<b>Link:</b> <%= referer %>
<p>
Enter the email address of the recipient<br>
<input type=\"text\" name=\"u_email\">
<input type=\"hidden\" name=\"title\" value=\"<%= title %>\">
<input type=\"hidden\" name=\"referer\" value=\"<%= referer %>\">
<input type=\"hidden\" name=\"u_submitted\" value=\"Yes\">
<input type=\"submit\" value=\"Sumbit\">

<% else
referer=request.form(\"referer\")
body = \"The following link was sent to you by a user of YourServer.com\"
body = body & \"Subject:\" & title
body = body & \"Link:\" & referer

\' This is the begining of the email creation and execution
\' Remove the comments befor each statement that begins with Set or sm
\' to actually send the mail message

\' Create a new mail object on the server
\' set sm = server.CreateObject(\"CDONTS.Newmail\")

\' Declare what address is sending the message
\' sm.from = \"requested_link@yourserver.com\"

\' Write the users subject to the subject of the email
\' sm.Subject = \"Requested Link:\" & title

\' Declare what address the message is being sent to
\' The Addressee is set to the inputted value
\' sm.to = u_email

\' Write the users message to the body of the email
\' sm.body = u_body

\' Send the message
\' sm.Send

\' Clean up the server object
\' set sm = nothing
%>
Your mail has been sent
<% end if \'end check for submiisson with an email address %>
</body>
</html>

virker ikke ?????? jeg tror det er fordi jeg ikke kan køre CDONTS, hvad skal jeg gøre for at bruge Jmail???
Avatar billede prof2 Nybegynder
18. november 2001 - 20:17 #1
Jeg tror det ikke virker fordi du har sat \' foran alle linjerne der skal sende mailen !!!
Avatar billede prof2 Nybegynder
18. november 2001 - 20:18 #2
<% else
referer=request.form(\"referer\")
body = \"The following link was sent to you by a user of YourServer.com\"
body = body & \"Subject:\" & title
body = body & \"Link:\" & referer

\' This is the begining of the email creation and execution
\' Remove the comments befor each statement that begins with Set or sm
\' to actually send the mail message

\' Create a new mail object on the server
set sm = server.CreateObject(\"CDONTS.Newmail\")

\' Declare what address is sending the message
sm.from = \"requested_link@yourserver.com\"

\' Write the users subject to the subject of the email
sm.Subject = \"Requested Link:\" & title

\' Declare what address the message is being sent to
\' The Addressee is set to the inputted value
sm.to = u_email

\' Write the users message to the body of the email
sm.body = u_body

\' Send the message
sm.Send

\' Clean up the server object
set sm = nothing
%>

virker nok lidt bedre :)
Avatar billede muffy Nybegynder
18. november 2001 - 20:30 #3
jeg tror slet ikke jeg kan bruge CDONTS help plz
Avatar billede muffy Nybegynder
25. november 2001 - 20:38 #4
got it done
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester