CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Help how to use <a href=mailto:

Print topic Send  topic

Author Message
Brian Bermingham
Posted: 10/04/2002, 8:16 AM

CCS + ASP
I'm trying to add <a href=mailto on a page with the To, Subject, and Body
taken from a database.
Getting the info from the db is no problem.
I have a label on the page and in the before show event I add the following
code.

Dim str, mailto, mailsubject, mailbody
mailto = "example@example.com"
mailsubject = "Just a test"
mailbody = "This is the body"

str = "<a href=mailto:" & mailto & "?Subject=" & mailsubject & "&Body=" &
mailbody & "><img tabindex=0 height=19 alt=Just a test hspace=0
src=images/icon_email_18.gif width=19 border=0></a>"

EventCaller.Value = str

This works perfectly if I remove the spaces from between the words in the
mailsubject and mailbody but if I leave the spaces the subject line shows as
Just only

I have tried playing about with CCToHTML and CCToURL without any success.

Am I missing something obvious?

Thanks

Brian Bermingham

Alexander
Posted: 10/04/2002, 8:53 AM

Hi Brian,

Please try the following:
str = "<a href=""mailto:" & Server.URLEncode(mailto) & "?Subject=" &
Server.URLEncode(mailsubject) & "&Body=" & _
Server.URLEncode(mailbody) & """><img tabindex=""0"" height=""19""
alt=""Just a test"" hspace=""0""" & _
"src=""images/icon_email_18.gif"" width=""19"" border=""0""></a>"

--
Alex

"Brian Bermingham" <brian.bermingham@getronics.com> wrote in message
news:ankbd8$q16$1@news.codecharge.com...
> CCS + ASP
> I'm trying to add <a href=mailto on a page with the To, Subject, and Body
> taken from a database.
> Getting the info from the db is no problem.
> I have a label on the page and in the before show event I add the
following
> code.
>
> Dim str, mailto, mailsubject, mailbody
> mailto = "example@example.com"
> mailsubject = "Just a test"
> mailbody = "This is the body"
>
> str = "<a href=mailto:" & mailto & "?Subject=" & mailsubject & "&Body=" &
> mailbody & "><img tabindex=0 height=19 alt=Just a test hspace=0
> src=images/icon_email_18.gif width=19 border=0></a>"
>
> EventCaller.Value = str
>
> This works perfectly if I remove the spaces from between the words in the
> mailsubject and mailbody but if I leave the spaces the subject line shows
as
> Just only
>
> I have tried playing about with CCToHTML and CCToURL without any success.
>
> Am I missing something obvious?
>
> Thanks
>
> Brian Bermingham
>
>

Ken
Posted: 10/04/2002, 10:42 AM

What I have done and works very effectively is to modify the HTML code where
the href line is and manually insert mailto: just before the {fieldname} so
it looks soemthing like this:
<a href="mailto:{emailfield}"...

Hope this helps!
"Brian Bermingham" <brian.bermingham@getronics.com> wrote in message
news:ankbd8$q16$1@news.codecharge.com...
> CCS + ASP
> I'm trying to add <a href=mailto on a page with the To, Subject, and Body
> taken from a database.
> Getting the info from the db is no problem.
> I have a label on the page and in the before show event I add the
following
> code.
>
> Dim str, mailto, mailsubject, mailbody
> mailto = "example@example.com"
> mailsubject = "Just a test"
> mailbody = "This is the body"
>
> str = "<a href=mailto:" & mailto & "?Subject=" & mailsubject & "&Body=" &
> mailbody & "><img tabindex=0 height=19 alt=Just a test hspace=0
> src=images/icon_email_18.gif width=19 border=0></a>"
>
> EventCaller.Value = str
>
> This works perfectly if I remove the spaces from between the words in the
> mailsubject and mailbody but if I leave the spaces the subject line shows
as
> Just only
>
> I have tried playing about with CCToHTML and CCToURL without any success.
>
> Am I missing something obvious?
>
> Thanks
>
> Brian Bermingham
>
>

Brian Bermingham
Posted: 10/04/2002, 10:54 AM

Thanks Alex

I had tried something similar using CCToURL.
Your code makes the mailsubject = Just+a+test and the mailbody =
This+is+the+body

I tried your code again but substituting Server.HTMLEncode for
Server.URLEncode
It now works, mailsubject = Just a test and the mailbody = This is the body

Brian

"Alexander" <alexander.netkachev@yessoftware.com> wrote in message
news:ankdhg$u07$1@news.codecharge.com...
> Hi Brian,
>
> Please try the following:
> str = "<a href=""mailto:" & Server.URLEncode(mailto) & "?Subject=" &
> Server.URLEncode(mailsubject) & "&Body=" & _
> Server.URLEncode(mailbody) & """><img tabindex=""0"" height=""19""
> alt=""Just a test"" hspace=""0""" & _
> "src=""images/icon_email_18.gif"" width=""19"" border=""0""></a>"
>
> --
> Alex
>
> "Brian Bermingham" <brian.bermingham@getronics.com> wrote in message
>news:ankbd8$q16$1@news.codecharge.com...
> > CCS + ASP
> > I'm trying to add <a href=mailto on a page with the To, Subject, and
Body
> > taken from a database.
> > Getting the info from the db is no problem.
> > I have a label on the page and in the before show event I add the
> following
> > code.
> >
> > Dim str, mailto, mailsubject, mailbody
> > mailto = "example@example.com"
> > mailsubject = "Just a test"
> > mailbody = "This is the body"
> >
> > str = "<a href=mailto:" & mailto & "?Subject=" & mailsubject & "&Body="
&
> > mailbody & "><img tabindex=0 height=19 alt=Just a test hspace=0
> > src=images/icon_email_18.gif width=19 border=0></a>"
> >
> > EventCaller.Value = str
> >
> > This works perfectly if I remove the spaces from between the words in
the
> > mailsubject and mailbody but if I leave the spaces the subject line
shows
> as
> > Just only
> >
> > I have tried playing about with CCToHTML and CCToURL without any
success.
> >
> > Am I missing something obvious?
> >
> > Thanks
> >
> > Brian Bermingham
> >
> >
>
>

Brian Bermingham
Posted: 10/04/2002, 11:00 AM

Thanks for the suggestion Ken
Alex's code, slightly modified, worked for me.
I'll try your method as well and see which is the easiest to use as I need
to add this to a few pages.

Brian


"Ken" <admin@kabwebs.com> wrote in message
news:ankjum$9ug$1@news.codecharge.com...
> What I have done and works very effectively is to modify the HTML code
where
> the href line is and manually insert mailto: just before the {fieldname}
so
> it looks soemthing like this:
> <a href="mailto:{emailfield}"...
>
> Hope this helps!
> "Brian Bermingham" <brian.bermingham@getronics.com> wrote in message
>news:ankbd8$q16$1@news.codecharge.com...
> > CCS + ASP
> > I'm trying to add <a href=mailto on a page with the To, Subject, and
Body
> > taken from a database.
> > Getting the info from the db is no problem.
> > I have a label on the page and in the before show event I add the
> following
> > code.
> >
> > Dim str, mailto, mailsubject, mailbody
> > mailto = "example@example.com"
> > mailsubject = "Just a test"
> > mailbody = "This is the body"
> >
> > str = "<a href=mailto:" & mailto & "?Subject=" & mailsubject & "&Body="
&
> > mailbody & "><img tabindex=0 height=19 alt=Just a test hspace=0
> > src=images/icon_email_18.gif width=19 border=0></a>"
> >
> > EventCaller.Value = str
> >
> > This works perfectly if I remove the spaces from between the words in
the
> > mailsubject and mailbody but if I leave the spaces the subject line
shows
> as
> > Just only
> >
> > I have tried playing about with CCToHTML and CCToURL without any
success.
> >
> > Am I missing something obvious?
> >
> > Thanks
> >
> > Brian Bermingham
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.