Issue when emailing and there is a space

I am emailing using CDOSYS.

The subject of the email is the name of the person. First name, middle and last name.

I added:     in between each recordset value to separate it in the subject of the email, but when emailed the space shows as a question mark.

So this, which is the value of the subject:

<input name="subject" type="text" class="bodytext" id="subject" value="<%=(Casesjoin.Fields.Item("FirstNm").Value)%>&nbsp;<%=(Casesjoin.Fields.Item("LastNm").Value)%> " size="100">

Will give me this:  Joe?Doe

How can i get rid of the question mark and simply have a space ?
Who is Participating?
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
I think you need to join the first and last in a separate variable before inserting it into the <input> statement.  Last I checked, the subject line of an email is supposed to be 7-bit ASCII.  Also, the data in the input statement goes thru a couple of steps before it is put in the subject line.
InputName = (Casesjoin.Fields.Item("FirstNm").Value) & " " & (Casesjoin.Fields.Item("LastNm").Value)

<input name="subject" type="text" class="bodytext" id="subject" value="<%=InputName %> " size="100"> 

Open in new window

Big MontyConnect With a Mentor Senior Web Developer / CEO of Commented:
have you tried with just a space?

<input name="subject" type="text" class="bodytext" id="subject" value="<%=(Casesjoin.Fields.Item("FirstNm").Value)%> <%=(Casesjoin.Fields.Item("LastNm").Value)%> " size="100">
AleksAuthor Commented:
I have, it doesn't add it. It simply puts the first and last name together.
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

AleksAuthor Commented:
Apparently has to do with the page header.
If I use this:


It adds an "A"

if I use this:

It adds a "?"

Big MontyConnect With a Mentor Senior Web Developer / CEO of Commented:
the code page provides encoding for certain types of languages. is this an issue that you need to be concerned about? if not you can safely remove it.
Tom BeckConnect With a Mentor Commented:
Try using String.Format:
<input name="subject" type="text" class="bodytext" id="subject" value='<%=
String.Format( "{0 1}", Casesjoin.Fields.Item("FirstNm").Value, Casesjoin.Fields.Item("LastNm").Value %> ' size="100">

Or maybe it should be like this:
<input name="subject" type="text" class="bodytext" id="subject" value='<%=
String.Format( "{0} {1}", Casesjoin.Fields.Item("FirstNm").Value, Casesjoin.Fields.Item("LastNm").Value %> ' size="100">
AleksAuthor Commented:
Joining them sounds like the best option, thanks for everyone's help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.