Im making a contact page that sends an email to our administration whenever someone types a message and sumbits it. Everything is working great until I try to concantenate the values from the textboxes in the email that is sent to admin.
Well it is a little embarrassing, but okay. Make sure when you are trying to pass a variable from a text field...to not clear the text fields before assigning the values to the variable...
ebngrtr083
Member
30 Points
28 Posts
need to concantenate variables to an email
Apr 10, 2012 11:36 PM|LINK
Hello,
Im making a contact page that sends an email to our administration whenever someone types a message and sumbits it. Everything is working great until I try to concantenate the values from the textboxes in the email that is sent to admin.
This is the code I want to send:
Dim mailsent As String = "From: " & firstName & " " & lastName & vbNewLine &
"Email: " & email & vbNewLine &
"Message: " & message
which should look like this in the email
From: John Doe
Email: John@email.com
Message: Message would go here...
The problem that I am having is when the email is recieved, it only shows this:
From:
Email:
Message:
Does anyon know what I am doing wrong here and what I need to do to fix it. Thank you all for your help.
aterra
Participant
910 Points
162 Posts
Re: need to concantenate variables to an email
Apr 10, 2012 11:47 PM|LINK
if the items are web controls you would need to firstName.Text, lastName.Text, ect. I am pretty sure default properties are no longer supported.
ebngrtr083
Member
30 Points
28 Posts
Re: need to concantenate variables to an email
Apr 10, 2012 11:59 PM|LINK
thank you for your help. I tried that also, but still ends up the same way
aterra
Participant
910 Points
162 Posts
Re: need to concantenate variables to an email
Apr 11, 2012 12:02 AM|LINK
What event is the code being fired from? Page_load, Page_Init or a button click?
ebngrtr083
Member
30 Points
28 Posts
Re: need to concantenate variables to an email
Apr 11, 2012 12:41 AM|LINK
Nevermind everyone. The reason why it wasn't working is because I'm a moron
thank you all for your help, but I figured it out
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: need to concantenate variables to an email
Apr 13, 2012 07:05 AM|LINK
Could you share your experience? It will help more people, thanks in advance!
Feedback to us
Develop and promote your apps in Windows Store
ebngrtr083
Member
30 Points
28 Posts
Re: need to concantenate variables to an email
Apr 13, 2012 05:55 PM|LINK
Well it is a little embarrassing, but okay. Make sure when you are trying to pass a variable from a text field...to not clear the text fields before assigning the values to the variable...