concatenate contents of variable with string

L

Len Burman

I have some code in a form which inputs a friends email address and when you
submit it sends the message to the person at the address. I want to be able
to email to the variable name and also a hard coded address. When I actually
input two addresses, it sends to both. The partial code reads:
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From= request.form("youremail") 'Specify sender's address
objMail.To=request.form("yourfriendemail")

yourfriendemail is a variable gotten from a form. I want to replace it with
the contents of yourfriendemail and (e-mail address removed). When I input on the
form (e-mail address removed); (e-mail address removed) it sends to both. I have tried concat()
adn using a + sign to concatenate.
 
C

Collin VanDyck

Len Burman said:
I have some code in a form which inputs a friends email address and when you
submit it sends the message to the person at the address. I want to be able
to email to the variable name and also a hard coded address. When I actually
input two addresses, it sends to both. The partial code reads:
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From= request.form("youremail") 'Specify sender's address
objMail.To=request.form("yourfriendemail")

yourfriendemail is a variable gotten from a form. I want to replace it with
the contents of yourfriendemail and (e-mail address removed). When I input on the
form (e-mail address removed); (e-mail address removed) it sends to both. I have tried concat()
adn using a + sign to concatenate.

Remember that Strings are immutable. That is, that they may not be changed.
Any string operation results in a brand new String, more or less.

Have you tried:

objMail.To = request.form("yourfriendemail").concat(";
(e-mail address removed)");

-CV
 
C

Christophe Vanfleteren

Len said:
I have some code in a form which inputs a friends email address and when
you submit it sends the message to the person at the address. I want to be
able to email to the variable name and also a hard coded address. When I
actually input two addresses, it sends to both. The partial code reads:
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From= request.form("youremail") 'Specify sender's address
objMail.To=request.form("yourfriendemail")

yourfriendemail is a variable gotten from a form. I want to replace it
with the contents of yourfriendemail and (e-mail address removed). When I input on
the form (e-mail address removed); (e-mail address removed) it sends to both. I have tried
concat() adn using a + sign to concatenate.

Might I suggest that you try to understand in what language you're
programming before asking someplace for help? Hint, it's not Java, not even
close. It looks like vb/vbscript/asp to me.
 
M

Michael Scovetta

Ok, You should be posting this to an ASP group-- this is Java-- totally different.

However, you should do something like:
objMail.To = request.form("yourfriendemail") & "; (e-mail address removed)"

-Mike Scovetta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top