This topic is locked

email hyperlink

4/20/2004 12:10:12 PM
ASPRunnerPro General questions
B
bilbo author

Using current version. I need to be able to setup the ability for user to click email record and it open an email message with the records from the record they have click on to be inserted into the email. Email hyper link works fine just can't see anywhere to allow a group of fields to be passed to the email. using access database need just to pass the id of the record selected and or some other fields.
regards bilbo

swat 4/20/2004

bilbo-
Here is the regular HTML code for email,with subject:

<a href="mailto:email@asprunner.com?subject=Web Site">webmaster</a>

And this is ASPRunner version:

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("EmailLink"), "") & """ & GetData(rsData.Fields("EmailLink"), "") & "</a>"

You can plug any HTML+ASP code to display your email link example:
&"subject = " GetData(rsData.Fields("ID"), "") &
I think this will help u to figure out

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1647&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

Sergey Kornilov admin 4/20/2004

Swat,
thank you for taking care of this question!
You can go even further and add body to this email:

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("EmailLink"), "") &

"?subject=" & GetData(rsData.Fields("subject"), "") & "&body=" & GetData(rsData.Fields("body"), "") &

""">" & GetData(rsData.Fields("EmailLink"), "") & "</a>"

B
bilbo author 4/20/2004

Many thanks for the swift replies what you have written makes sense. It would make more sense if I knew which asp file this needs adding to and where. I have tried looking but with no luck, if you could save my sanity and just point me (holding my hand) in the right direction.

swat 4/20/2004

bilbo-
This code goes to your asprunner list page, which I assume would be ....._list.asp Open this ..list.asp file and u will see all the way the bottom there is ASP codes that display your datafields.

................

Response.Write GetData(rsData.Fields("Name "") , "")

................

Response.Write GetData(rsData.Fields("LastName"), "")

..............

Response.Write GetData(rsData.Fields("EmailLink"), "") .

.........................


After u find out this part of the code just replace where u display "EmailLink" to admin'scode thats all..
Before:

Response.Write GetData(rsData.Fields("EmailLink"), "") .


After:

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("EmailLink"), "") & _

"?subject=" & GetData(rsData.Fields("subject"), "") & "&body=" & GetData(rsData.Fields("body"), "") & _

""">" & GetData(rsData.Fields("EmailLink"), "") & "</a>"


hope this will help you
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1658&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

B
bilbo author 4/21/2004

All i can find in the xxxx_list.asp file is this
if IsBinaryField(rsData.Fields("Email")) or Format("Email")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rsData, "Email", "")

else

Response.Write ProcessLargeText(GetData(rsData.Fields("Email"), "Email Hyperlink"))

end if
and i have changed in to this
if IsBinaryField(rsData.Fields("Email")) or Format("Email")=FORMAT_DATABASEFILE then

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("EmailLink"), "") &


"?subject=" & "hello" & "&body=" & "hello2" & _

""">" & GetData(rsData.Fields("EmailLink"), "") & "</a>"

else

Response.Write ProcessLargeText(GetData(rsData.Fields("Email"), "Email Hyperlink"))

end if
This does not change how the asp runs in use ie click email link email open with just email address in place only. I have tried searching for just the code you list no luck. I know this is going to be something really stupid but for the life of me I can't see the code you list.
regards Bilbs

swat 4/21/2004

bilbo-
Replace this code :

if IsBinaryField(rsData.Fields("Email")) or Format("Email")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rsData, "Email", "")

else

Response.Write ProcessLargeText(GetData(rsData.Fields("Email"), "Email Hyperlink"))

end if


with this one :

if (rsData.Fields("Email")) <> "" then

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("Email"), "") & _

"?subject=" & "hello" & "&body=" & "hello2" & _

""">" & GetData(rsData.Fields("Email"), "") & "</a>"

end if
B
bilbo author 4/21/2004

HTTP 500 - Internal server error

Internet Explorer
page crashes out with this error is I change the code listed in the above reply

Sergey Kornilov admin 4/21/2004

Bilbo,
please post here code section that you have inserted.

swat 4/21/2004

bilbo-
I have tested this code again it works just fine...

if rsData.Fields("EmailLink") <> "" then

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("EmailLink"), "") & _

"?subject=" & "hello" & "&body=" & "hello2" & _

""">" & GetData(rsData.Fields("EmailLink"), "") & "</a>"

end if


Make sure you have stored this code in right place <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1668&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />

B
bilbo author 4/21/2004

Got it to work using the following;

if IsBinaryField(rsData.Fields("Email")) or Format("Email")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rsData, "Email", "")

 else

Response.Write ProcessLargeText("<a href=""mailto:" & GetData(rsData.Fields("Email"), "") &_

"?subject=Property id  " & GetData(rsData.Fields("id"), "") & "&body=Please forward me information with regards this property " &_

GetData(rsData.Fields("id"), "") )& """>Click to request info!</a>"

 end if

%>


Many thanks swat and admin for your help, far great product and the forum really works
Regards Bilbo (Bilbs)

500086 5/12/2004

Hi, I have managed to get this to work <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1813&image=1&table=forumreplies' class='bbcemoticon' alt=':P' /> , but I am stuck with the body content. Can anyone tell me how to put carriage returns and other html into the body section. I want to be able to hit the link in the asprunner page and send a fixed email message to the customer.
I have used this (from Swat - thanks)
if (rsData.Fields("Email")) <> "" then

Response.Write "<a href=""mailto:" & GetData(rsData.Fields("Email"), "") &

"?subject=" & "Using Nutrafem" & "&body=" & ".........A very big email message needs to go in here.............." & _

""">" & GetData(rsData.Fields("Email"), "") & "</a>"

end if
Laura

Life again saved by ASPRunner.

Sergey Kornilov admin 5/13/2004

Laura,
you can use something like this for this purpose:

if (rsData.Fields("Email")) <> "" then

  Response.Write "<a href=""mailto:" & GetData(rsData.Fields("Email"), "") &

"?subject=" & "Using Nutrafem" & "&body=" & "First line%0d%0aSecond line%0d%0a..." &


""">" & GetData(rsData.Fields("Email"), "") & "</a>"

end if


I hope this helps.

500087 5/14/2004

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1840&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> Thank you, that's perfect.

500088 4/8/2005

How about if I want to the user to be able to send the current page they are viewing by email to someone?