Solved

Issue when emailing and there is a space

Posted on 2013-12-19
7
418 Views
Last Modified: 2013-12-19
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 ?
0
Comment
Question by:amucinobluedot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 39729820
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">
0
 

Author Comment

by:amucinobluedot
ID: 39729941
I have, it doesn't add it. It simply puts the first and last name together.
0
 

Author Comment

by:amucinobluedot
ID: 39729948
Apparently has to do with the page header.
If I use this:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

It adds an "A"

if I use this:

It adds a "?"

???
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 39729968
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.
0
 
LVL 38

Assisted Solution

by:Tom Beck
Tom Beck earned 125 total points
ID: 39729994
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">
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 125 total points
ID: 39730173
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

0
 

Author Closing Comment

by:amucinobluedot
ID: 39730634
Joining them sounds like the best option, thanks for everyone's help.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question