Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with an email script

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have the following email script that I created and it gives me a syntax error on this line

&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;email&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;email&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & theemail & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _

I don't see what the problem is. Can someone see something I am missing?? Here is my completed code.

Dim ssn as String
ssn = fidssn.text
Dim thename as String
thename = name.text
Dim theemail as String
theemail = emailaddress.text
Dim thefund as string
thefund = fund.SelectedItem.Value
Dim thebroker as String
thebroker = brokerage.text
Dim theinfo as String
theinfo = requestinfo.SelectedItem.Value
Dim otherinfo as String
otherinfo = other.text

Dim objMailMessage As MailMessage
Dim strHTMLBody As String

strHTMLBody = &quot;<html>&quot; & _
&quot;<head>&quot; & _
&quot;<title>WC Occurrence Report</title>&quot; & _
&quot;<body>&quot; & _
&quot;<table width=&quot;&quot;45%&quot;&quot; border=&quot;&quot;3&quot;&quot; cellpadding=&quot;&quot;0&quot;&quot; cellspacing=&quot;&quot;0&quot;&quot; class=&quot;&quot;forms&quot;&quot; bordercolor=&quot;&quot;#000066&quot;&quot;>&quot; & _
&quot;<tr><td width=&quot;&quot;49%&quot;&quot; height=&quot;&quot;40&quot;&quot;>What is your Federal ID or Social Security Number?</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><p>&quot; & _
&quot;<input name=&quot;&quot;FID/SSN&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;FID/SSN&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & ssn & &quot;&quot;&quot; size=90 maxlength=100>&quot; & _
&quot;</p></td></tr><tr>&quot; & _
&quot;<td width=&quot;&quot;49%&quot;&quot;>What is your name?</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;name&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;name&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & thename & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _
&quot;</tr><tr><td width=&quot;&quot;49%&quot;&quot;>What is your e-mail address?</td>&quot;
&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;email&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;email&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & theemail & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _
&quot;</tr><tr> <td width=&quot;&quot;49%&quot;&quot;>What is the name of the fund you have questions about?</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;fund&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;fund&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & thefund & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _
&quot;</tr><tr><td width=&quot;&quot;49%&quot;&quot;>What is the name of your brokerage firm if you use one?</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;broker&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;broker&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & thebroker & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _
&quot;</tr><tr><td width=&quot;&quot;49%&quot;&quot;>What information are you requesting?</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><input name=&quot;&quot;request&quot;&quot; type=&quot;&quot;text&quot;&quot; id=&quot;&quot;request&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & theinfo & &quot;&quot;&quot; size=90 maxlength=100></td>&quot; & _
&quot;</tr><tr><td width=&quot;49%&quot;>Request other information.</td>&quot; & _
&quot;<td width=&quot;&quot;51%&quot;&quot;><textarea name=&quot;&quot;other&quot;&quot; cols=&quot;&quot;40&quot;&quot; rows=&quot;&quot;10&quot;&quot; id=&quot;&quot;other&quot;&quot; readonly=&quot;&quot;true&quot;&quot; value=&quot;&quot;&quot; & otherinfo & &quot;&quot;&quot; wrap=&quot;&quot;virtual&quot;&quot;>
&quot;</tr><tr></tr></table>&quot;

objMailMessage = New MailMessage
objMailMessage.From= &quot;comments@am1st.com&quot;
objMailMessage.To= &quot;comments@am1st.com&quot;
objMailMessage.Subject = &quot;Comments From Investor Services Web Site&quot;
objMailMessage.Body = strHTMLBody
objMailMessage.BodyFormat = MailFormat.HTML
objMailMessage.Priority = MailPriority.High
SmtpMail.Send( objMailMessage )
End If
 
Nevermind, just after I posted this I realized I was missing a & _
 
Hey if I may suggest something you should use a stringbuilder. It is a lot faster and more effecient with concatinating strings. Just a tweek.

Check out link9's FAQ.

FAQ855-1882 That'l do donkey, that'l do
[bravo] Mark
 
I have a question on Email. If you use the above method for sending emails. How would you send the results of a Checkboxlist???
 
Not sure I understand. Everything you want to send must be in string format. Just get think about what you want the message to look like and format the string into that mental image.

I think I may completely off what you want if you can explain more I can help. That'l do donkey, that'l do
[bravo] Mark
 
Okay say I have the following code.

<asp:checkboxlist ID=&quot;testing&quot; runat=&quot;server&quot;>
<asp:listitem Text=&quot;Beer&quot; Value=&quot;Beer&quot;/>
<asp:listitem Text=&quot;Cigars&quot; Value=&quot;Cigars&quot; />
<asp:listitem Text=&quot;football&quot; Value=&quot;football&quot; />
</asp:checkboxlist>

if your using the earlier method where you taking what the user entered into a form and emailing that information. How would I display this checkbox list in that email with the items selected checked???
 
in the HTML that you are building and sending through email I would select the item selected

<asp:checkboxlist ID=&quot;testing&quot; runat=&quot;server&quot;>
<asp:listitem Text=&quot;Beer&quot; Value=&quot;Beer&quot; Checked=true/>
<asp:listitem Text=&quot;Cigars&quot; Value=&quot;Cigars&quot; />
<asp:listitem Text=&quot;football&quot; Value=&quot;football&quot; />
</asp:checkboxlist>

to determine wich one was selected by the user you should build an if statement around it.

hth Daren J. Lahey
Just another computer guy...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top