OPERATOR '&' IS NOT DEFINED

D

dancer

Juan and Mark,

We are kindred spirits on the garish appearance. I hate even WEB SITES that are not designed with restraint and taste. And if there is EVER anything that moves or talks on a web site, I leave it immediately!
Obviously, I have not clearly stated my problem and my goal.
At the moment, supervisors are filling out a paper form by hand with a pen. That is delivered by truck mail to the safety director. It is then put in the employee's individual file. This will take the place of that.
Forms, as you know, have boxes, lines, directions, check boxes, large fonts, small fonts.
I do not need color. I just need it to look like a form, which is pretty much what the web page will look like.

Is there any other way to do that?

By the way, I have not seen the ASP101 in HTML, because the validation section won't accept my e-mail. My e-mail is in the format of (e-mail address removed). I notice the validation code seems to want only one name before the @server.com and I don't know how to change it. Could you help me with that?

Thank you


"Juan T. Llibre said:
> I assume you mean you hate HTML email.

Yes, I meant that, although I don't hate it for the HTML itself.
I hate it when background colors, garish font colors and many fonts are used.

re:
> Perhaps you have a better idea for returning the information to the Safety Director?

My suggestion stands : get rid of the useless HTML tags and background color.

Business mail should be business-like in appearance.

You *can* send HTML mail with a white background, using a single standard font like Arial,
bolding the headlines and/or paragraph headings, using a larger font size for headlines,
and keeping the use of color to a minimum...or even not using it at all.

Your Safety Director will appreciate that in your business report, I'm sure.

I formatted this response as HTML to show you what the ASP101
sample looks like when formatted with business mail in mind:

-------------

Sample Message
This message was sent from a sample at ASP101.

It is used to show people how to send HTML formatted email from an ASP.NET page.
If you did not request this email yourself, your address was entered by one of our visitors.

We do not store these e-mail addresses

--------

Notice the difference...
Instead of the garish yellow background in the original sample, you have a clean, crisp, business format.

Good luck and, if you run into more problems, post back.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
J

Juan T. Llibre

re:
!> I just need it to look like a form, which is pretty much what the web page will look like.
!> Is there any other way to do that?

No, there isn't. Use the HTML if you need it, and apparently you do.
Just don't go ga-ga on it.

:)

re:
!> I notice the validation code seems to want only one name before the
!> @server.com and I don't know how to change it. Could you help me with that?

Sure. Just substitute this ValidationExpression for the one you have now:

ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"

Copy and past the whole line, so there's no transcription mistakes.

That RegExp matches 99.99% of e-mail addresses.

The {2,7} at the end leaves space for top level domains
as short as .do but leaves room for longer ones like .info, .museum, etc.

It also matches :
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ( Notice the underscore )
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
....and many other combinations.





Juan and Mark,

We are kindred spirits on the garish appearance. I hate even WEB SITES that are not designed with
restraint and taste. And if there is EVER anything that moves or talks on a web site, I leave it
immediately!

Obviously, I have not clearly stated my problem and my goal.
At the moment, supervisors are filling out a paper form by hand with a pen. That is delivered by
truck mail to the safety director. It is then put in the employee's individual file. This will
take the place of that.

Forms, as you know, have boxes, lines, directions, check boxes, large fonts, small fonts.
I do not need color. I just need it to look like a form, which is pretty much what the web page
will look like.

Is there any other way to do that?

By the way, I have not seen the ASP101 in HTML, because the validation section won't accept my
e-mail. My e-mail is in the format of (e-mail address removed). I notice the validation code
seems to want only one name before the @server.com and I don't know how to change it. Could you
help me with that?

Thank you


re:
> I assume you mean you hate HTML email.

Yes, I meant that, although I don't hate it for the HTML itself.
I hate it when background colors, garish font colors and many fonts are used.

re:
> Perhaps you have a better idea for returning the information to the Safety Director?

My suggestion stands : get rid of the useless HTML tags and background color.

Business mail should be business-like in appearance.

You *can* send HTML mail with a white background, using a single standard font like Arial,
bolding the headlines and/or paragraph headings, using a larger font size for headlines,
and keeping the use of color to a minimum...or even not using it at all.

Your Safety Director will appreciate that in your business report, I'm sure.

I formatted this response as HTML to show you what the ASP101
sample looks like when formatted with business mail in mind:

-------------

Sample Message
This message was sent from a sample at ASP101.

It is used to show people how to send HTML formatted email from an ASP.NET page.
If you did not request this email yourself, your address was entered by one of our visitors.

We do not store these e-mail addresses

--------

Notice the difference...
Instead of the garish yellow background in the original sample, you have a clean, crisp, business
format.

Good luck and, if you run into more problems, post back.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
M

Mark Rae

re:
!> I just need it to look like a form, which is pretty much what the web
page will look like.
!> Is there any other way to do that?

No, there isn't. Use the HTML if you need it, and apparently you do.
Just don't go ga-ga on it.

:)

And don't complain, or even be surprised, if some of your recipients reject
your emails because they're not plain text...

Some people are like that... ;-)
 
J

Juan T. Llibre

re:
!> And don't complain, or even be surprised, if some of your recipients reject
!> your emails because they're not plain text...

Sure, but he only wants supervisors to send reports
as HTML email to one person : his boss, the Safety Director.

I'm sure he'll explain to his boss that the reports are HTML-formatted so they look prettier.
Bosses like that. All he needs to do now is make sure his boss can read HTML email.

:)
 
M

Mark Rae

re:
!> And don't complain, or even be surprised, if some of your recipients
reject
!> your emails because they're not plain text...

Sure, but he only wants supervisors to send reports
as HTML email to one person : his boss, the Safety Director.

Oh right - sorry, I didn't pick up on that...
I'm sure he'll explain to his boss that the reports are HTML-formatted so
they look prettier.
Bosses like that. All he needs to do now is make sure his boss can read
HTML email.

:)

He might be lucky...!
 
D

dancer

ALSO, I will need to send the information to a database that accumulates all
the data for a review of total accidents. Would it be better to just make a
pretty report from that database?
Of course, I know nothing of code to send to a database. That's probably 10
times harder than what I'm trying now. Is it?

I appreciate your help.



Juan T. Llibre said:
re:
!> I just need it to look like a form, which is pretty much what the web
page will look like.
!> Is there any other way to do that?

No, there isn't. Use the HTML if you need it, and apparently you do.
Just don't go ga-ga on it.

:)

re:
!> I notice the validation code seems to want only one name before the
!> @server.com and I don't know how to change it. Could you help me with
that?

Sure. Just substitute this ValidationExpression for the one you have now:

ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"

Copy and past the whole line, so there's no transcription mistakes.

That RegExp matches 99.99% of e-mail addresses.

The {2,7} at the end leaves space for top level domains
as short as .do but leaves room for longer ones like .info, .museum, etc.

It also matches :
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ( Notice the underscore )
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
...and many other combinations.





Juan and Mark,

We are kindred spirits on the garish appearance. I hate even WEB SITES
that are not designed with restraint and taste. And if there is EVER
anything that moves or talks on a web site, I leave it immediately!

Obviously, I have not clearly stated my problem and my goal.
At the moment, supervisors are filling out a paper form by hand with a
pen. That is delivered by truck mail to the safety director. It is then
put in the employee's individual file. This will take the place of
that.

Forms, as you know, have boxes, lines, directions, check boxes, large
fonts, small fonts.
I do not need color. I just need it to look like a form, which is pretty
much what the web page will look like.

Is there any other way to do that?

By the way, I have not seen the ASP101 in HTML, because the validation
section won't accept my e-mail. My e-mail is in the format of
(e-mail address removed). I notice the validation code seems to
want only one name before the @server.com and I don't know how to change
it. Could you help me with that?

Thank you


re:
I assume you mean you hate HTML email.

Yes, I meant that, although I don't hate it for the HTML itself.
I hate it when background colors, garish font colors and many fonts are
used.

re:
Perhaps you have a better idea for returning the information to the
Safety Director?

My suggestion stands : get rid of the useless HTML tags and background
color.

Business mail should be business-like in appearance.

You *can* send HTML mail with a white background, using a single standard
font like Arial,
bolding the headlines and/or paragraph headings, using a larger font size
for headlines,
and keeping the use of color to a minimum...or even not using it at all.

Your Safety Director will appreciate that in your business report, I'm
sure.

I formatted this response as HTML to show you what the ASP101
sample looks like when formatted with business mail in mind:

-------------

Sample Message
This message was sent from a sample at ASP101.

It is used to show people how to send HTML formatted email from an
ASP.NET page.
If you did not request this email yourself, your address was entered by
one of our visitors.

We do not store these e-mail addresses

--------

Notice the difference...
Instead of the garish yellow background in the original sample, you have
a clean, crisp, business format.

Good luck and, if you run into more problems, post back.





dancer said:
Thank you, Juan. I will try again.
You said, "I, personally, hate email sent to me as it's too gaudy, but to
each his own."
I assume you mean you hate HTML email. The reason I want HTML email is so
that the Safety Director can see what the supervisor entered in the online
investigation report in the SAME FORMAT as the supervisor saw it.
Perhaps you have a better idea for returning the information to the Safety
Director?
I would love another option.
 
M

Mark Rae

ALSO, I will need to send the information to a database that accumulates
all the data for a review of total accidents. Would it be better to just
make a pretty report from that database?
Of course, I know nothing of code to send to a database. That's probably
10 times harder than what I'm trying now. Is it?

Hmm - I appreciate that you're a "newbie", but maybe you should take a step
back here and actually evaluate your requirements properly, and then come up
with a design which meets them all...

Is this principally a system for data gathering?

If so, then you will almost certainly want to use that as your starting
point...

Does the intended recipient of this report (which is causing you so much
trouble) have access to your network? If so, then there's absolutely no need
to email anything anywhere, as there are plenty of reporting solutions for
ASP.NET...
 
D

dancer

No, data gathering is a second goal.
The first goal is having a report in hand that looks like the form that they
are now filling out on paper.

Re: "....as there are plenty of reporting solutions for
ASP.NET.."
What kind of reporting solutions?
 
D

David

What Mark is probably suggesting is that you create your application to
store the information in the database. There is no need for an email, as
your boss is likely to have access to your webserver.

If your boss can see the webserver, he can search through the accident
reports and display them on his screen just however you want him to see
them. Makes it MUCH more versatile.

If I was you, I would offer that as a solution, with the benefit of
searchable and much easier to gain statistics from as well, which makes it
also much easier to discover patterns in accidents. You can still send him
an email with a simple line to say a new report has been submitted and give
him a link to open it directly.

Go through the quickstart guide on www.asp.net and also try some of the
tutorials on the microsoft site for visual web developer 2005. It really
sounds like at the moment, you are out of your depth. As Mark says, you do
really need to step back, look at the bigger picture and offer various
solutions. You need to learn how to develop the solution. We are happy to
help or point you in the right direction, but I can't help thinking you have
quite a steep learning curve.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
M

Mark Rae

What Mark is probably suggesting is that you create your application to
store the information in the database. There is no need for an email, as
your boss is likely to have access to your webserver.

If your boss can see the webserver, he can search through the accident
reports and display them on his screen just however you want him to see
them. Makes it MUCH more versatile.

Correct.
 
D

dancer

Yes, I realize I have a steep learning curve.
Right now, I need something "quick and dirty" while I study, now that you've
pointed me in the right direction.
So I'm thinking the e-mail will solve it until I can create a more elegant
solution. Do you agree?
So you may be seeing more from me on this.

Thank you.
 
D

dancer

These are all links to 3rd party solutions, which mean I have to learn
ASP.net, VB, AND the 3rd party software.
Is it not possible to do it just in the programming language??
 
M

Mark Rae

These are all links to 3rd party solutions, which mean I have to learn
ASP.net, VB, AND the 3rd party software.

The first three are all Microsoft solutions...
Is it not possible to do it just in the programming language??

Your learning curve is surely steep enough without trying to roll your own
reporting engine... :)
 
D

David

Why not ask him what he would like?

Tell him he can have quick and dirty or he can have an all singing all
dancing system, but that the all singing all dancing will take you a little
longer. Personally, I would develop the code to put it into the database
(you must have much of that already done, just got to insert into the
database now) then give him database access and he can at least look at the
detail (albeit a bit rough) until you get a web page written.

Look at the examples on the net. Ask here (after looking at the examples).

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


dancer said:
Yes, I realize I have a steep learning curve.
Right now, I need something "quick and dirty" while I study, now that
you've pointed me in the right direction.
So I'm thinking the e-mail will solve it until I can create a more elegant
solution. Do you agree?
So you may be seeing more from me on this.

Thank you.
 
D

dancer

Juan,
Why do we need
<%@Page Language="VB" ClientTarget="downlevel"%> ?

Thanks






Juan T. Llibre said:
re:
!> I just need it to look like a form, which is pretty much what the web
page will look like.
!> Is there any other way to do that?

No, there isn't. Use the HTML if you need it, and apparently you do.
Just don't go ga-ga on it.

:)

re:
!> I notice the validation code seems to want only one name before the
!> @server.com and I don't know how to change it. Could you help me with
that?

Sure. Just substitute this ValidationExpression for the one you have now:

ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"

Copy and past the whole line, so there's no transcription mistakes.

That RegExp matches 99.99% of e-mail addresses.

The {2,7} at the end leaves space for top level domains
as short as .do but leaves room for longer ones like .info, .museum, etc.

It also matches :
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ( Notice the underscore )
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
...and many other combinations.





Juan and Mark,

We are kindred spirits on the garish appearance. I hate even WEB SITES
that are not designed with restraint and taste. And if there is EVER
anything that moves or talks on a web site, I leave it immediately!

Obviously, I have not clearly stated my problem and my goal.
At the moment, supervisors are filling out a paper form by hand with a
pen. That is delivered by truck mail to the safety director. It is then
put in the employee's individual file. This will take the place of
that.

Forms, as you know, have boxes, lines, directions, check boxes, large
fonts, small fonts.
I do not need color. I just need it to look like a form, which is pretty
much what the web page will look like.

Is there any other way to do that?

By the way, I have not seen the ASP101 in HTML, because the validation
section won't accept my e-mail. My e-mail is in the format of
(e-mail address removed). I notice the validation code seems to
want only one name before the @server.com and I don't know how to change
it. Could you help me with that?

Thank you


re:
I assume you mean you hate HTML email.

Yes, I meant that, although I don't hate it for the HTML itself.
I hate it when background colors, garish font colors and many fonts are
used.

re:
Perhaps you have a better idea for returning the information to the
Safety Director?

My suggestion stands : get rid of the useless HTML tags and background
color.

Business mail should be business-like in appearance.

You *can* send HTML mail with a white background, using a single standard
font like Arial,
bolding the headlines and/or paragraph headings, using a larger font size
for headlines,
and keeping the use of color to a minimum...or even not using it at all.

Your Safety Director will appreciate that in your business report, I'm
sure.

I formatted this response as HTML to show you what the ASP101
sample looks like when formatted with business mail in mind:

-------------

Sample Message
This message was sent from a sample at ASP101.

It is used to show people how to send HTML formatted email from an
ASP.NET page.
If you did not request this email yourself, your address was entered by
one of our visitors.

We do not store these e-mail addresses

--------

Notice the difference...
Instead of the garish yellow background in the original sample, you have
a clean, crisp, business format.

Good luck and, if you run into more problems, post back.





dancer said:
Thank you, Juan. I will try again.
You said, "I, personally, hate email sent to me as it's too gaudy, but to
each his own."
I assume you mean you hate HTML email. The reason I want HTML email is so
that the Safety Director can see what the supervisor entered in the online
investigation report in the SAME FORMAT as the supervisor saw it.
Perhaps you have a better idea for returning the information to the Safety
Director?
I would love another option.
 
J

Juan T. Llibre

re:
!> Why do we need
!> <%@Page Language="VB" ClientTarget="downlevel"%> ?

You don't need it.

If you want to disable client-side form validation,
you can do so by adding the downlevel directive.

Doing so will ensure that only HTML 3.2 is sent to the browser.

If your people use IE 5+, IE 6 or IE 7, you can use :

<%@Page Language="VB"%>

You probably will want to disable ViewState and SessionState, too.
That will make the page "lighter".

<%@ Page Language="VB" EnableViewState= "false" EnableSessionState = "false" %>





dancer said:
Juan,
Why do we need
<%@Page Language="VB" ClientTarget="downlevel"%> ?

Thanks






Juan T. Llibre said:
re:
!> I just need it to look like a form, which is pretty much what the web page will look like.
!> Is there any other way to do that?

No, there isn't. Use the HTML if you need it, and apparently you do.
Just don't go ga-ga on it.

:)

re:
!> I notice the validation code seems to want only one name before the
!> @server.com and I don't know how to change it. Could you help me with that?

Sure. Just substitute this ValidationExpression for the one you have now:

ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"

Copy and past the whole line, so there's no transcription mistakes.

That RegExp matches 99.99% of e-mail addresses.

The {2,7} at the end leaves space for top level domains
as short as .do but leaves room for longer ones like .info, .museum, etc.

It also matches :
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ( Notice the underscore )
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
...and many other combinations.





Juan and Mark,

We are kindred spirits on the garish appearance. I hate even WEB SITES that are not designed
with restraint and taste. And if there is EVER anything that moves or talks on a web site, I
leave it immediately!

Obviously, I have not clearly stated my problem and my goal.
At the moment, supervisors are filling out a paper form by hand with a pen. That is delivered by
truck mail to the safety director. It is then put in the employee's individual file. This
will take the place of that.

Forms, as you know, have boxes, lines, directions, check boxes, large fonts, small fonts.
I do not need color. I just need it to look like a form, which is pretty much what the web page
will look like.

Is there any other way to do that?

By the way, I have not seen the ASP101 in HTML, because the validation section won't accept my
e-mail. My e-mail is in the format of (e-mail address removed). I notice the validation
code seems to want only one name before the @server.com and I don't know how to change it. Could
you help me with that?

Thank you


re:
I assume you mean you hate HTML email.

Yes, I meant that, although I don't hate it for the HTML itself.
I hate it when background colors, garish font colors and many fonts are used.

re:
Perhaps you have a better idea for returning the information to the Safety Director?

My suggestion stands : get rid of the useless HTML tags and background color.

Business mail should be business-like in appearance.

You *can* send HTML mail with a white background, using a single standard font like Arial,
bolding the headlines and/or paragraph headings, using a larger font size for headlines,
and keeping the use of color to a minimum...or even not using it at all.

Your Safety Director will appreciate that in your business report, I'm sure.

I formatted this response as HTML to show you what the ASP101
sample looks like when formatted with business mail in mind:

-------------

Sample Message
This message was sent from a sample at ASP101.

It is used to show people how to send HTML formatted email from an ASP.NET page.
If you did not request this email yourself, your address was entered by one of our visitors.

We do not store these e-mail addresses

--------

Notice the difference...
Instead of the garish yellow background in the original sample, you have a clean, crisp,
business format.

Good luck and, if you run into more problems, post back.





dancer said:
Thank you, Juan. I will try again.
You said, "I, personally, hate email sent to me as it's too gaudy, but to
each his own."
I assume you mean you hate HTML email. The reason I want HTML email is so
that the Safety Director can see what the supervisor entered in the online
investigation report in the SAME FORMAT as the supervisor saw it.
Perhaps you have a better idea for returning the information to the Safety
Director?
I would love another option.



re:
!> A part of Juan's reply was Something else : you *must* put all the HTML
!> content in ONE line.

I meant : "all the HTML content in ONE line".

The sample at ASP101 places all the HTML content in ONE line,
even though it composes that single line in several lines.

That's why you need to use VbCrLf and the underscore ( _ ):
to COMPOSE a single line over several lines of code.

Confusing ? You betcha.

Also, you're inverting the order of the VbCrLf and the underscore,
which is why the sample is blowing up on you.

i.e., you have :

objMM.Body = DateTime.Now + " HI " & _
"<html>" & vbCrLf & vbCrLf & _
"<head>" & vbCrLf & vbCrLf & _
"</head>"& vbCrLf & vbCrLf & _
"<body>" & vbCrLf & vbCrLf & _

etc....

When what you should have is :

objMM.Body = DateTime.Now + " HI " _
& "<html>" & vbCrLf & vbCrLf _
& "<head>" & vbCrLf & vbCrLf _
& "</head>"& vbCrLf & vbCrLf _
& "<body>" & vbCrLf & vbCrLf _
etc...

i.e., the underscore goes at the end of the line
you want to break, BEFORE the ampersand on the next line.
Even more confusing is adding unneeded HTML tags to an HTML body
which doesn't need them, unless you need to have a background color.
 
D

dancer

Hi Juan,
I'm back!!!!!
I know I have a LONG way to go, but I know a LOT more now than a week ago
when I started. You have clarified many things in the last couple days.
Can you tell me why my variables don't work?
I tried Dim Location As String = Location.Text but got error messages.
With this I don't get error messages, but neither does it return the value
of the variable.

Thank you again.

<@ Page Language="VB" ClientTarget="downlevel" %>
<%@ Import Namespace="System.Web.Mail" %>
<script language="VB" runat="server">
Sub btnSendMail_OnClick(Source As Object, E As EventArgs)

Dim Location As String = Location
Dim Who As String = Who
Dim Check1 As String
Dim myMessage As New MailMessage
Dim myMail As SmtpMail
Dim strEmail As String


If Page.IsValid() Then
strEmail = txtEmail.Text
'Location = Location.Text



myMessage.From = "(e-mail address removed)"
myMessage.To = strEmail
myMessage.Subject = "E-mail Sample (HTML)"

' This is the magic line. Without this the message will just appear
' as plain HTML and won't be rendered by the recipient's email client.
' It'd be as if they did "View Source" on a web page.
MyMessage.BodyFormat = MailFormat.Html

' This is multi-lined simply for readability.
' Notice that it is a properly formatted HTML
' message and not just plain text like most email.
' A lot of people have asked how to use form data
' in the emails so I added an example of including
' the entered address in the body of the email.
myMessage.Body = "<h2>Wheeler's Accident Investigation Form</h2>" &
vbCrLf _
& " <p>" & vbCrLf _
& " Place where accident occurred: " & location & "<br>" & vbCrLf _
& " Who was injured:" & who & "<br>" & vbCrLf _
& " Employer's Premises?" & check1 & "<br>"

' Doesn't have to be local... just enter your
' SMTP server's name or ip address!
myMail.SmtpServer = ""
myMail.Send(myMessage)

frmEmail.Visible = False
lblUserMessage.Text = "An HTML-formatted email message has been sent to "
& strEmail & "."
lblUserMessage.Text = "Place of accident" & location
End If
End Sub
</script>

<html>
<head>
<title>ASP.NET Email (HTML Format) Sample</title>
</head>
<body>

<table width="750" bgcolor="#E9EDF4" table border="1" cellpadding="3">
<h3><center><font face="Verdana">Wheeler's Accident Investigation
Form</font></center></h3>


<asp:Label id="lblUserMessage" text="Enter your e-mail address:"
runat="server" />
<form method="post" id="frmEmail" runat="server">
<asp:TextBox id="txtEmail" size="30" runat="server" />

<asp:RegularExpressionValidator runat="server"
id="validEmailRegExp" ControlToValidate="txtEmail"
ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"
errormessage="Please enter a valid email address."
Display="Dynamic" />

<asp:Button id="btnSendMail" text="Send Mail!"
OnClick="btnSendMail_OnClick" runat="server" />


<hr>
<%--____________________________________________________________________________--%> <%--ROW 1--%> <td width="250" valign="top"> <font face="Verdana" Size="2"> Location where accident occurred: <asp:textbox id="Location"runat=server Width="200"/> </td> <td align="right" valign="top" width="225"> <font face="Verdana" Size="2">Employer's Premises <asp:CheckBox id=Check1 Text="yes" runat="server" /> <asp:CheckBox id=Check2 Text="no" runat="server" /> <br> Job site <asp:CheckBox id=Check3 Text="yes" runat="server" /> <asp:CheckBox id=Check4 Text="no" runat="server" /> </td><td> <font face="Verdana" Size="2">Date of accident</font><br> <asp:textbox id="Date" runat=server Width="100"/></td> <%--____________________________________________________________________________--%><%--ROW 2--%><tr> <td> <font face="Verdana" Size="2">Who was injured?</font><br> <asp:textbox id="Who" runat=server width="200"/> </td> <td align= "left"> <font face="Verdana" Size="2">Employee <asp:CheckBox id=Check5runat="server" /> <br> Non-employee <asp:CheckBox id=Check6 runat="server" /> </td> <td align="right"><font face="Verdana" Size="2"> Time of accident a.m. <asp:textbox id="am" runat=server Width="90"/> p.m. <asp:textbox id="pm" runat=server Width="90"/> </TD> <%--____________________________________________________________________________--%><%--ROW 3--%> <tr> <td> <font face="Verdana" Size="2">Date of Hire <br> <asp:textbox id="Hiredate"runat=server/> </td> <td> <font face="Verdana" Size="2">Job Title or Occupation <br><asp:textboxid="occupation" runat=server width="200"/> </td> <td> <font face="Verdana" Size="2">How long has employee workedat job where injury occurred?<br><asp:textbox id="lengthofjob"runat=server/> </td><%--____________________________________________________________________________--%><%--Row 4--%> &nbsp&nbsp <p> <asp:Label id=Label1 font-name="arial" font-size="10pt"runat="server"/></form><hr /></body></html>"Juan T. Llibre" <[email protected]> wrote in messagenews:[email protected]...> re:> !> A part of Juan's reply was Something else : you *must* put all the HTML> !> content in ONE line.>> I meant : "all the HTML content in ONE line".>> The sample at ASP101 places all the HTML content in ONE line,> even though it composes that single line in several lines.>> That's why you need to use VbCrLf and the underscore ( _ ):> to COMPOSE a single line over several lines of code.>> Confusing ? You betcha.>> Also, you're inverting the order of the VbCrLf and the underscore,> which is why the sample is blowing up on you.>> i.e., you have :>> objMM.Body = DateTime.Now + " HI " & _> "<html>" & vbCrLf & vbCrLf & _> "<head>" & vbCrLf & vbCrLf & _> "</head>"& vbCrLf & vbCrLf & _> "<body>" & vbCrLf & vbCrLf & _>> etc....>> When what you should have is :>> objMM.Body = DateTime.Now + " HI " _> & "<html>" & vbCrLf & vbCrLf _> & "<head>" & vbCrLf & vbCrLf _> & "</head>"& vbCrLf & vbCrLf _> & "<body>" & vbCrLf & vbCrLf _> etc...>> i.e., the underscore goes at the end of the line> you want to break, BEFORE the ampersand on the next line.>> Even more confusing is adding unneeded HTML tags to an HTML body> which doesn't need them, unless you need to have a background color.>> Here's a version of the ASP101 sample without the> unneeded HTML tags and *with* HTML format :>> <%@ Page Language="VB" ClientTarget="downlevel" %>> <%@ Import Namespace="System.Web.Mail" %>> <script language="VB" runat="server">> Sub btnSendMail_OnClick(Source As Object, E As EventArgs)> Dim myMessage As New MailMessage> Dim myMail As SmtpMail> Dim strEmail As String>> If Page.IsValid() Then> strEmail = txtEmail.Text>> myMessage.From = "admin@" & Request.ServerVariables("SERVER_NAME")> myMessage.To = strEmail> myMessage.Subject = "E-mail Sample (HTML)">> ' This is the magic line. Without this the message will just appear> ' as plain HTML and won't be rendered by the recipient's email client.> ' It'd be as if they did "View Source" on a web page.> MyMessage.BodyFormat = MailFormat.Html>> ' This is multi-lined simply for readability.> ' Notice that it is a properly formatted HTML> ' message and not just plain text like most email.> ' A lot of people have asked how to use form data> ' in the emails so I added an example of including> ' the entered address in the body of the email.> myMessage.Body = "<h2>Sample Message</h2>" & vbCrLf _> & " <p>" & vbCrLf _> & " This message was sent from a sample at" & vbCrLf _> & " <a href=""http://yourserver.com"">Your Server 101</a>." & vbCrLf _> & " It is used to show people how to send HTML" & vbCrLf _> & " formatted email from an ASP.NET page." & vbCrLf _> & " If you did not request this email yourself," & vbCrLf _> & " your address was entered by one of our" & vbCrLf _> & " visitors." & vbCrLf _> & " <strong>" & vbCrLf _> & " We do not store these e-mail addresses." & vbCrLf _> & " </strong>" & vbCrLf _> & " </p>" & vbCrLf _> & " <p><font size=""-1"">Please address all concerns (e-mail address removed).</font></p>" & vbCrLf _> & " <p><font size=""-1"">This message was sent to: " & strEmail &"</font></p>">> ' Doesn't have to be local... just enter your> ' SMTP server's name or ip address!> myMail.SmtpServer = "YourSMTPServer"> myMail.Send(myMessage)>> frmEmail.Visible = False> lblUserMessage.Text = "An HTML-formatted email message has been sent to" & strEmail & "."> End If> End Sub> </script>>> <html>> <head>> <title>ASP.NET Email (HTML Format) Sample</title>> </head>> <body>>> <asp:Label id="lblUserMessage" text="Enter your e-mail address:"runat="server" />> <form method="post" id="frmEmail" runat="server">> <asp:TextBox id="txtEmail" size="30" runat="server" />> <asp:RequiredFieldValidator runat="server"> id="validEmailRequired" ControlToValidate="txtEmail"> errormessage="Please enter an email address."> display="Dynamic" />> <asp:RegularExpressionValidator runat="server"> id="validEmailRegExp" ControlToValidate="txtEmail"> ValidationExpression="^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$"> errormessage="Please enter a valid email address."> Display="Dynamic" />>> <asp:Button id="btnSendMail" text="Send Mail!"OnClick="btnSendMail_OnClick" runat="server" />> </form>>> <hr />>> </body>> </html>>> ------------------>> You'll see that it compiles just fine and sends perfectly formatted HTML> without the need for those extra HTML tags ( <html>, <head>, <body><meta...>.>> Of course, if you want the yellow background, or any other color,> or a background image, include the HTML tags.>> I, personally, hate email sent to me as it's too gaudy, but to each hisown.>> Make sure you substitute your SMTP server's name before running the page:>> myMail.SmtpServer = "YourSMTPServer">>>>> Juan T. Llibre, asp.net MVP> asp.net faq : http://asp.net.do/faq/> foros de asp.net, en español : http://asp.net.do/foros/> ===================================> "dancer" <[email protected]> wrote in messagenews:[email protected]...>> Also, David,>> I had asked why do I get this error message:>> Compiler Error Message: BC30452: Operator '&' is not defined for typesString' and 'System.Web.UI.WebControls.TextBox'.>>>> A part of Juan's reply was Something else : you *must* put all the HTMLcontent in ONE line.>>>> Do you have any thoughts on that error message?>>>>>> "David" <[email protected]> wrote in messagenews:[email protected]...>>> Ah,>>>>>> Sorry, I have my newsreader on to ignore read messages.>>>>>> The P tags break the lines in the rendered page. BR tags also breaklines (work as a hard wrap).>>>>>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does isallow the source html wrap onto a new line, so that your line is not toolong.>>>>>> If you want to use the same thing in C#, then it is something like...>>>>>> email.Body = "This is my email body\nNow I am on a new line\nNote thebackslash and n to create a new line\n. I can't remember though, you mightneed \r\n to create a new line";>>>>>> backslash n.>>>>>> Is that what you looking for? This however doesn't affect your renderedoutput. use \n where there is vbcrlf, however, vbcrlf is a defined constant,and \n has to be in quotes.>>>>>> What you could do though is...>>>>>> string vbCrLf = "\n";>>>>>> -->>> Best regards,>>> Dave Colliver.>>> http://www.AshfieldFOCUS.com>>> ~~>>> http://www.FOCUSPortals.com - Local franchises available>>> "dancer" <[email protected]> wrote in messagenews:[email protected]...>>>> David,>>>>>>>> Not exactly does this answer my question. Could you please check outJuan's answer to my first post on this subject and help me understand, sinceI was copying my code from this code.>>>>>>>> Thank you.>>>>>>>>>>>> "David" <[email protected]> wrote in messagenews:%[email protected]...>>>>> The vbCrLf are purely to ensure that the line is not too long whengenerated. There is a problem with over long lines that when they doeventually wrap, it can disrupt your formatted email.>>>>>>>>>> You will note that there are no br tags, but there are p tags <p> and</p>. These are what cause <P>aragraph breaks. (Actually, they are for newparagraphs rather than breaking paragraphs).>>>>>>>>>> Does this answer your question?>>>>>>>>>> (Note, you probably can't press "Yes" below as you probably can't seeit. If you can, then you have better eyes than me, as I can't see it. :)>>>>>>>>>> -->>>>> Best regards,>>>>> Dave Colliver.>>>>> http://www.AshfieldFOCUS.com>>>>> ~~>>>>> http://www.FOCUSPortals.com - Local franchises available>>>>>>>>>> "dancer" <[email protected]> wrote in messagenews:[email protected]...>>>>>> Hi Juan,>>>>>>>>>>>> What is the difference in what I am trying to do and this? Why canTHEY break up the HTML content into different lines?>>>>>>>>>>>> email_html.aspx>>>>>> -------------------------------------------------------------------------------->>>>>>>>>>>> <%@ Page Language="VB" ClientTarget="downlevel" %>>>>>>> <%@ Import Namespace="System.Web.Mail" %>>>>>>> <script language="VB" runat="server">>>>>>> Sub btnSendMail_OnClick(Source As Object, E As EventArgs)>>>>>> Dim myMessage As New MailMessage>>>>>> Dim myMail As SmtpMail>>>>>> Dim strEmail As String>>>>>>>>>>>> If Page.IsValid() Then>>>>>> strEmail = txtEmail.Text>>>>>>>>>>>> 'myMessage.From = "webmaster@" &Request.ServerVariables("SERVER_NAME")>>>>>> myMessage.From = "(e-mail address removed)">>>>>> myMessage.To = strEmail>>>>>> myMessage.Subject = "E-mail Sample (HTML) from ASP 101!">>>>>>>>>>>> ' This is the magic line. Without this the message will just appear>>>>>> ' as plain HTML and won't be rendered by the recipient's emailclient.>>>>>> ' It'd be as if they did "View Source" on a web page.>>>>>> MyMessage.BodyFormat = MailFormat.Html>>>>>>>>>>>> ' This is multi-lined simply for readability.>>>>>> ' Notice that it is a properly formatted HTML>>>>>> ' message and not just plain text like most email.>>>>>> ' A lot of people have asked how to use form data>>>>>> ' in the emails so I added an example of including>>>>>> ' the entered address in the body of the email.>>>>>> myMessage.Body = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0Transitional//EN"">" & vbCrLf _>>>>>> & "<html>" & vbCrLf _>>>>>> & "<head>" & vbCrLf _>>>>>> & " <title>Sample Message From ASP 101</title>" & vbCrLf _>>>>>> & " <meta http-equiv=Content-Type content=""text/html;charset=iso-8859-1"">" & vbCrLf _>>>>>> & "</head>" & vbCrLf _>>>>>> & "<body bgcolor=""#FFFFCC"">" & vbCrLf _>>>>>> & " <h2>Sample Message From ASP 101</h2>" & vbCrLf _>>>>>> & " <p>" & vbCrLf _>>>>>> & " This message was sent from a sample at" & vbCrLf _>>>>>> & " <a href=""http://www.asp101.com"">ASP 101</a>." & vbCrLf _>>>>>> & " It is used to show people how to send HTML" & vbCrLf _>>>>>> & " formatted email from an ASP.NET page." & vbCrLf _>>>>>> & " If you did not request this email yourself," & vbCrLf _>>>>>> & " your address was entered by one of our" & vbCrLf _>>>>>> & " visitors." & vbCrLf _>>>>>> & " <strong>" & vbCrLf _>>>>>> & " We do not store these e-mail addresses." & vbCrLf _>>>>>> & " </strong>" & vbCrLf _>>>>>> & " </p>" & vbCrLf _>>>>>> & " <p><font size=""-1"">Please address all concerns (e-mail address removed).</font></p>" & vbCrLf _>>>>>> & " <p><font size=""-1"">This message was sent to: " & strEmail &"</font></p>" & vbCrLf _>>>>>> & "</body>" & vbCrLf _>>>>>> & "</html>" & vbCrLf>>>>>>>>>>>> ' Doesn't have to be local... just enter your>>>>>> ' SMTP server's name or ip address!>>>>>> myMail.SmtpServer = "localhost">>>>>> myMail.Send(myMessage)>>>>>>>>>>>> frmEmail.Visible = False>>>>>> lblUserMessage.Text = "An HTML-formatted email message has been sentto " & strEmail & ".">>>>>> End If>>>>>> End Sub>>>>>> </script>>>>>>>>>>>>> <html>>>>>>> <head>>>>>>> <title>ASP.NET Email (HTML Format) Sample</title>>>>>>> </head>>>>>>> <body>>>>>>>>>>>>> <asp:Label id="lblUserMessage" text="Enter your e-mail address:"runat="server" />>>>>>> <form method="post" id="frmEmail" runat="server">>>>>>> <asp:TextBox id="txtEmail" size="30" runat="server" />>>>>>> <asp:RequiredFieldValidator runat="server">>>>>> id="validEmailRequired" ControlToValidate="txtEmail">>>>>> errormessage="Please enter an email address.">>>>>> display="Dynamic" />>>>>>> <asp:RegularExpressionValidator runat="server">>>>>> id="validEmailRegExp" ControlToValidate="txtEmail">>>>>> ValidationExpression="^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$">>>>>> errormessage="Please enter a valid email address.">>>>>> Display="Dynamic" />>>>>>>>>>>>> <asp:Button id="btnSendMail" text="Send Mail!"OnClick="btnSendMail_OnClick" runat="server" />>>>>>> </form>>>>>>>>>>>>> <hr />>>>>>>>>>>>> <p>>>>>>> Click <ahref="http://www.asp101.com/samples/email_html_aspx.asp">here</a> to readabout and download the source code.>>>>>> </p>>>>>>>>>>>>> </body>>>>>>> </html>>>>>>>>>>>>>>>>>>> -------------------------------------------------------------------------------->>>>>>>>>>>> "Juan T. Llibre" <[email protected]> wrote in messageYou don't need to set the html/head/body tags within the HTML body>>>>>>> ...and, in the VbCrLf thread, we established that you can't useVbCrLf in HTML.>>>>>>>>>>>>>> Something else : you *must* put all the HTML content in ONE line.>>>>>>> You can't break the lines with code.>>>>>>>>>>>>>> Get rid of all the "VbCrLf" and all the "&" and write all your HTMLin a single line,>>>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" asneeded.>>>>>>>>>>>>>> Also, you can't insert Textbox controls into your HTML.>>>>>>>>>>>>>> So, Check1.Text is out, too.>>>>>>>>>>>>>> If you want to reference their content, after a user fills them out,>>>>>>> capture it to a variable and use that, before writing to the body.>>>>>>>>>>>>>> insert :>>>>>>>>>>>>>> Dim Check1 as String = Check1.Text>>>>>>> Dim Check2 as String = Check2.Text>>>>>>> Dim Location as String = Location.Text>>>>>>> before "Dim objMM as New MailMessage()">>>>>>>>>>>>>> and, when composing the body, use :>>>>>>>>>>>>>> mail.Body="Hi, <p>The location where the accident occurred is :" &Location & "<br/>" & Check1 & ".">>>>>>> ' etc.>>>>>>>>>>>>>> You *can* use the & to reference text variables.>>>>>>> Notice the location of the quote marks.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Juan T. Llibre, asp.net MVP>>>>>>> asp.net faq : http://asp.net.do/faq/>>>>>>> foros de asp.net, en español : http://asp.net.do/foros/>>>>>>> ===================================>>>>>>> "dancer" <[email protected]> wrote in messageCan somebody tell me why I get this message with the followingcode?>>>>>>>>>>>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined fortypes 'String' and>>>>>>>> 'System.Web.UI.WebControls.TextBox'.>>>>>>>>>>>>>>>> <html>>>>>>>>>>>>>>>>> <head>>>>>>>>>>>>>>>>> <% @Import Namespace="System.Web.Mail" %>>>>>>>>>>>>>>>>> <script language="VB" runat="server">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Sub btnSendFeedback_Click(sender as Object, e as EventArgs)>>>>>>>>>>>>>>>> 'Create an instance of the MailMessage class>>>>>>>>>>>>>>>> Dim objMM as New MailMessage()>>>>>>>>>>>>>>>> 'Set the properties - send the email to the person who filled outthe>>>>>>>>>>>>>>>> 'feedback form.>>>>>>>>>>>>>>>> objMM.To = "(e-mail address removed)">>>>>>>>>>>>>>>>>>>>>>>> objMM.From = "(e-mail address removed)">>>>>>>>>>>>>>>> 'send in html format>>>>>>>>>>>>>>>> objMM.BodyFormat = MailFormat.html>>>>>>>>>>>>>>>> 'Set the priority - options are High, Low, and Normal>>>>>>>>>>>>>>>> objMM.Priority = MailPriority.Normal>>>>>>>>>>>>>>>> 'Set the subject>>>>>>>>>>>>>>>> objMM.Subject = "Accident Investigation Form">>>>>>>>>>>>>>>>>>>>>>>> 'Set the body>>>>>>>>>>>>>>>> objMM.Body = DateTime.Now + " HI " & _>>>>>>>>>>>>>>>> "<html>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "<head>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "</head>"& vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "<body>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> Location where accident occurred:>>>>>>>>>>>>>>>> Location.Text & _>>>>>>>>>>>>>>>> "<br>"& _>>>>>>>>>>>>>>> 7> Check1.Text & "." & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> vbCrLf &vbCrLf & _>>>>>>>>>>>>>>>> Check2.Text & vbCrLf & _>>>>>>>>>>>>>>>> "</td>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "</body>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "</html>">>>>>>>>>>>>>>>>>>>>>>>> 'Specify to use the default Smtp Server>>>>>>>>>>>>>>>> SmtpMail.SmtpServer = "">>>>>>>>>>>>>>>> 'Now, to send the message, use the Send method of the SmtpMailclass>>>>>>>>>>>>>>>> SmtpMail.Send(objMM)>>>>>>>>>>>>>>>> panelSendEmail.Visible = false>>>>>>>>>>>>>>>> panelMailSent.Visible = true>>>>>>>>>>>>>>>> End Sub>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> </script>>>>>>>>>>>>>>>>> </head>>>>>>>>>>>>>>>>>>>>>>>>> <body>>>>>>>>>>>>>>>>> <table width="750" bgcolor="#E9EDF4" table border="1"cellpadding="3">>>>>>>>>>>>>>>>> <h3><center><font face="Verdana">Wheeler's Accident InvestigationForm</font></h3>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <hr>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>> <%--ROW 1--%>>>>>>>>>>>>>>>>>>>>>>>>> <td width="250" valign="top">>>>>>>>>>>>>>>>>>>>>>>>> <form runat="server">>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">>>>>>>>>>>>>>>>> Location where accident occurred: <asp:textbox id="Location"runat=server Width="200"/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td align="right" valign="top" width="225">>>>>>>>>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Employer's Premises>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <asp:CheckBox id=Check1 Text="yes" runat="server" />>>>>>>>>>>>>>>>> <asp:CheckBox id=Check2 Text="no" runat="server" />>>>>>>>>>>>>>>>> <br>>>>>>>>>>>>>>>>>>>>>>>>> Job site>>>>>>>>>>>>>>>> <asp:CheckBox id=Check3 Text="yes" runat="server" />>>>>>>>>>>>>>>>> <asp:CheckBox id=Check4 Text="no" runat="server" />>>>>>>>>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Date of accident</font><br>>>>>>>>>>>>>>>>> <asp:textbox id="Date" runat=server Width="100"/>>>>>>>>>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>> <%--ROW 2--%>>>>>>>>>>>>>>>>>>>>>>>>> <tr> <td>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Who was injured?</font><br>>>>>>>>>>>>>>>>> <asp:textbox id="Who" runat=server width="200"/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td align= "left">>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Employee <asp:CheckBox id=Check5runat="server" />>>>>>>>>>>>>>>>> <br>>>>>>>>>>>>>>>>> Non-employee <asp:CheckBox id=Check6 runat="server" />>>>>>>>>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td align="right"><font face="Verdana" Size="2">>>>>>>>>>>>>>>>> Time of accident a.m. <asp:textbox id="am" runat=serverWidth="90"/>>>>>>>>>>>>>>>>> p.m. <asp:textbox id="pm" runat=server Width="90"/>>>>>>>>>>>>>>>>> </TD>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>> <%--ROW 3--%>>>>>>>>>>>>>>>>> <tr>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Date of Hire <br> <asp:textboxid="Hiredate" runat=server/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">Job Title or Occupation<br><asp:textbox id="occupation">>>>>>>> runat=server width="200"/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana" Size="2">How long has employee worked at jobwhere injury>>>>>>>> occurred?<br><asp:textbox id="lengthofjob" runat=server/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>> <%--Row 4--%>>>>>>>>>>>>>>>>> &nbsp&nbsp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <p>>>>>>>>>>>>>>>>>>>>>>>>> <asp:Label id=Label1 font-name="arial" font-size="10pt"runat="server"/>>>>>>>>>>>>>>>>> <!Copied from /smirnof>>>>>>>>>>>>>>>>> <asp:panel id="panelSendEmail" runat="server">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <%--asp:textbox id= runat="server" /--%>>>>>>>>>>>>>>>>> <br>>>>>>>>>>>>>>>>> <b>Your Message:</b><br>>>>>>>>>>>>>>>>> <%--asp:textbox id="txtMessage" TextMode="MultiLine">>>>>>>>>>>>>>>> Columns="40" Rows="10" runat="server" /--%>>>>>>>>>>>>>>>>> <p>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <asp:button runat="server" id="btnSendFeedback" Text="Send>>>>>>>>>>>>>>>> Feedback!">>>>>>>>>>>>>>>> OnClick="btnSendFeedback_Click" />>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> </asp:panel>>>>>>>>>>>>>>>>> <asp:panel id="panelMailSent" runat="server" Visible="False">>>>>>>>>>>>>>>>> An email has been sent to the email address you specified.>>>>>>>>>>>>>>>> Thanks!>>>>>>>>>>>>>>>> </asp:panel>>>>>>>>>>>>>>>>> </form>>>>>>>>>>>>>>>>> </body>>>>>>>>>>>>>>>>> </html>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
D

David

If Location is a text box, then when you dim Location, you are effectively
trying to redefine Location. As you dim it as a string, the string does not
have a .Text value, so yes, it will fail.

Try...

Dim MyLocation As String = Location.Text

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


dancer said:
Hi Juan,
I'm back!!!!!
I know I have a LONG way to go, but I know a LOT more now than a week ago
when I started. You have clarified many things in the last couple days.
Can you tell me why my variables don't work?
I tried Dim Location As String = Location.Text but got error
messages.
With this I don't get error messages, but neither does it return the value
of the variable.

Thank you again.

<@ Page Language="VB" ClientTarget="downlevel" %>
<%@ Import Namespace="System.Web.Mail" %>
<script language="VB" runat="server">
Sub btnSendMail_OnClick(Source As Object, E As EventArgs)

Dim Location As String = Location
Dim Who As String = Who
Dim Check1 As String
Dim myMessage As New MailMessage
Dim myMail As SmtpMail
Dim strEmail As String


If Page.IsValid() Then
strEmail = txtEmail.Text
'Location = Location.Text



myMessage.From = "(e-mail address removed)"
myMessage.To = strEmail
myMessage.Subject = "E-mail Sample (HTML)"

' This is the magic line. Without this the message will just appear
' as plain HTML and won't be rendered by the recipient's email client.
' It'd be as if they did "View Source" on a web page.
MyMessage.BodyFormat = MailFormat.Html

' This is multi-lined simply for readability.
' Notice that it is a properly formatted HTML
' message and not just plain text like most email.
' A lot of people have asked how to use form data
' in the emails so I added an example of including
' the entered address in the body of the email.
myMessage.Body = "<h2>Wheeler's Accident Investigation Form</h2>" &
vbCrLf _
& " <p>" & vbCrLf _
& " Place where accident occurred: " & location & "<br>" & vbCrLf _
& " Who was injured:" & who & "<br>" & vbCrLf _
& " Employer's Premises?" & check1 & "<br>"

' Doesn't have to be local... just enter your
' SMTP server's name or ip address!
myMail.SmtpServer = ""
myMail.Send(myMessage)

frmEmail.Visible = False
lblUserMessage.Text = "An HTML-formatted email message has been sent to
" & strEmail & "."
lblUserMessage.Text = "Place of accident" & location
End If
End Sub
</script>

<html>
<head>
<title>ASP.NET Email (HTML Format) Sample</title>
</head>
<body>

<table width="750" bgcolor="#E9EDF4" table border="1" cellpadding="3">
<h3><center><font face="Verdana">Wheeler's Accident Investigation
Form</font></center></h3>


<asp:Label id="lblUserMessage" text="Enter your e-mail address:"
runat="server" />
<form method="post" id="frmEmail" runat="server">
<asp:TextBox id="txtEmail" size="30" runat="server" />

<asp:RegularExpressionValidator runat="server"
id="validEmailRegExp" ControlToValidate="txtEmail"
ValidationExpression="^[\w-]+(\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$"
errormessage="Please enter a valid email address."
Display="Dynamic" />

<asp:Button id="btnSendMail" text="Send Mail!"
OnClick="btnSendMail_OnClick" runat="server" />


<hr>
<%--____________________________________________________________________________--%>
<%--ROW 1--%> <td width="250" valign="top"> <font
face="Verdana" Size="2"> Location where accident occurred:
<asp:textbox id="Location"runat=server Width="200"/> </td> <td
align="right" valign="top" width="225"> <font face="Verdana"
Size="2">Employer's Premises <asp:CheckBox id=Check1 Text="yes"
runat="server" /> <asp:CheckBox id=Check2 Text="no" runat="server"
/> <br> Job site <asp:CheckBox id=Check3 Text="yes" runat="server"
/> <asp:CheckBox id=Check4 Text="no" runat="server" /> </td><td>
<font face="Verdana" Size="2">Date of accident</font><br> <asp:textbox
id="Date" runat=server Width="100"/></td>
<%--____________________________________________________________________________--%><%--ROW
2--%><tr> <td> <font face="Verdana" Size="2">Who was injured?</font><br>
<asp:textbox id="Who" runat=server width="200"/> </td> <td align=
"left"> <font face="Verdana" Size="2">Employee <asp:CheckBox
id=Check5runat="server" /> <br> Non-employee <asp:CheckBox id=Check6
runat="server" /> </td> <td align="right"><font face="Verdana"
Size="2"> Time of accident a.m. <asp:textbox id="am" runat=server
Width="90"/> p.m. <asp:textbox id="pm" runat=server Width="90"/> </TD>
<%--____________________________________________________________________________--%><%--ROW
3--%> <tr> <td> <font face="Verdana" Size="2">Date of Hire <br>
<asp:textbox id="Hiredate"runat=server/> </td> <td> <font
face="Verdana" Size="2">Job Title or Occupation
<br><asp:textboxid="occupation" runat=server width="200"/> </td> <td>
<font face="Verdana" Size="2">How long has employee workedat job where
injury occurred?<br><asp:textbox id="lengthofjob"runat=server/>
</td><%--____________________________________________________________________________--%><%--Row
4--%> &nbsp&nbsp <p> <asp:Label id=Label1 font-name="arial"
font-size="10pt"runat="server"/></form><hr /></body></html>"Juan T.
messagere:> !> A part of
Juan's reply was Something else : you *must* put all the HTML> !> content
in ONE line.>> I meant : "all the HTML content in ONE line".>> The sample
at ASP101 places all the HTML content in ONE line,> even though it
composes that single line in several lines.>> That's why you need to use
VbCrLf and the underscore ( _ ):> to COMPOSE a single line over several
lines of code.>> Confusing ? You betcha.>> Also, you're inverting the
order of the VbCrLf and the underscore,> which is why the sample is
blowing up on you.>> i.e., you have :>> objMM.Body = DateTime.Now + " HI "
& _> "<html>" & vbCrLf & vbCrLf & _> "<head>" & vbCrLf & vbCrLf & _>
"</head>"& vbCrLf & vbCrLf & _> "<body>" & vbCrLf & vbCrLf & _>> etc....>>
When what you should have is :>> objMM.Body = DateTime.Now + " HI " _> &
"<html>" & vbCrLf & vbCrLf _> & "<head>" & vbCrLf & vbCrLf _> &
"</head>"& vbCrLf & vbCrLf _> & "<body>" & vbCrLf & vbCrLf _> etc...>>
i.e., the underscore goes at the end of the line> you want to break,
BEFORE the ampersand on the next line.>> Even more confusing is adding
unneeded HTML tags to an HTML body> which doesn't need them, unless you
need to have a background color.>> Here's a version of the ASP101 sample
without the> unneeded HTML tags and *with* HTML format :>> <%@ Page
Language="VB" ClientTarget="downlevel" %>> <%@ Import
Namespace="System.Web.Mail" %>> <script language="VB" runat="server">> Sub
btnSendMail_OnClick(Source As Object, E As EventArgs)> Dim myMessage
As New MailMessage> Dim myMail As SmtpMail> Dim strEmail As
String>> If Page.IsValid() Then> strEmail = txtEmail.Text>>
myMessage.From = "admin@" & Request.ServerVariables("SERVER_NAME")>
myMessage.To = strEmail> myMessage.Subject = "E-mail Sample
(HTML)">> ' This is the magic line. Without this the message will just
appear> ' as plain HTML and won't be rendered by the recipient's email
client.> ' It'd be as if they did "View Source" on a web page.>
MyMessage.BodyFormat = MailFormat.Html>> ' This is multi-lined simply
for readability.> ' Notice that it is a properly formatted HTML> '
message and not just plain text like most email.> ' A lot of people have
asked how to use form data> ' in the emails so I added an example of
including> ' the entered address in the body of the email.>
myMessage.Body = "<h2>Sample Message</h2>" & vbCrLf _> & " <p>" &
vbCrLf _> & " This message was sent from a sample at" & vbCrLf _> &
" <a href=""http://yourserver.com"">Your Server 101</a>." & vbCrLf _>
& " It is used to show people how to send HTML" & vbCrLf _> & "
formatted email from an ASP.NET page." & vbCrLf _> & " If you did not
request this email yourself," & vbCrLf _> & " your address was entered
by one of our" & vbCrLf _> & " visitors." & vbCrLf _> & "
<strong>" & vbCrLf _> & " We do not store these e-mail addresses." &
vbCrLf _> & " </strong>" & vbCrLf _> & " </p>" & vbCrLf _> & "
<p><font size=""-1"">Please address all concerns
(e-mail address removed).</font></p>" & vbCrLf _> & " <p><font
size=""-1"">This message was sent to: " & strEmail &"</font></p>">> '
Doesn't have to be local... just enter your> ' SMTP server's name or ip
address!> myMail.SmtpServer = "YourSMTPServer">
myMail.Send(myMessage)>> frmEmail.Visible = False> lblUserMessage.Text
= "An HTML-formatted email message has been sent to" & strEmail & ".">
End If> End Sub> </script>>> <html>> <head>> <title>ASP.NET Email (HTML
Format) Sample</title>> </head>> <body>>> <asp:Label id="lblUserMessage"
text="Enter your e-mail address:"runat="server" />> <form method="post"
id="frmEmail" runat="server">> <asp:TextBox id="txtEmail" size="30"
runat="server" />> <asp:RequiredFieldValidator runat="server">
id="validEmailRequired" ControlToValidate="txtEmail">
errormessage="Please enter an email address."> display="Dynamic" />>
<asp:RegularExpressionValidator runat="server"> id="validEmailRegExp"
ControlToValidate="txtEmail">
ValidationExpression="^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$">
errormessage="Please enter a valid email address."> Display="Dynamic"
/>>> <asp:Button id="btnSendMail" text="Send
Mail!"OnClick="btnSendMail_OnClick" runat="server" />> </form>>> <hr />>>
</body>> </html>>> ------------------>> You'll see that it compiles just
fine and sends perfectly formatted HTML> without the need for those extra
HTML tags ( <html>, <head>, <body><meta...>.>> Of course, if you want the
yellow background, or any other color,> or a background image, include the
HTML tags.>> I, personally, hate email sent to me as it's too gaudy, but
to each hisown.>> Make sure you substitute your SMTP server's name before
running the page:>> myMail.SmtpServer = "YourSMTPServer">>>>> Juan T.
Llibre, asp.net MVP> asp.net faq : http://asp.net.do/faq/> foros de
asp.net, en español : http://asp.net.do/foros/>
in messageAlso, David,>> I
had asked why do I get this error message:>> Compiler Error Message:
BC30452: Operator '&' is not defined for typesString' and
'System.Web.UI.WebControls.TextBox'.>>>> A part of Juan's reply was
Something else : you *must* put all the HTMLcontent in ONE line.>>>> Do
you have any thoughts on that error message?>>>>>> "David"
messageAh,>>>>>> Sorry, I
have my newsreader on to ignore read messages.>>>>>> The P tags break the
lines in the rendered page. BR tags also breaklines (work as a hard
wrap).>>>>>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this
does isallow the source html wrap onto a new line, so that your line is
not toolong.>>>>>> If you want to use the same thing in C#, then it is
something like...>>>>>> email.Body = "This is my email body\nNow I am on a
new line\nNote thebackslash and n to create a new line\n. I can't remember
though, you mightneed \r\n to create a new line";>>>>>> backslash n.>>>>>>
Is that what you looking for? This however doesn't affect your
renderedoutput. use \n where there is vbcrlf, however, vbcrlf is a defined
constant,and \n has to be in quotes.>>>>>> What you could do though
is...>>>>>> string vbCrLf = "\n";>>>>>> -->>> Best regards,>>> Dave
Colliver.>>> http://www.AshfieldFOCUS.com>>> ~~>>>
http://www.FOCUSPortals.com - Local franchises available>>> "dancer"
messageDavid,>>>>>>>>
Not exactly does this answer my question. Could you please check
outJuan's answer to my first post on this subject and help me understand,
sinceI was copying my code from this code.>>>>>>>> Thank you.>>>>>>>>>>>>
messageThe vbCrLf are
purely to ensure that the line is not too long whengenerated. There is a
problem with over long lines that when they doeventually wrap, it can
disrupt your formatted email.>>>>>>>>>> You will note that there are no br
tags, but there are p tags <p> and</p>. These are what cause <P>aragraph
breaks. (Actually, they are for newparagraphs rather than breaking
paragraphs).>>>>>>>>>> Does this answer your question?>>>>>>>>>> (Note,
you probably can't press "Yes" below as you probably can't seeit. If you
can, then you have better eyes than me, as I can't see it.
:)>>>>>>>>>> -->>>>> Best regards,>>>>> Dave Colliver.>>>>>
http://www.AshfieldFOCUS.com>>>>> ~~>>>>> http://www.FOCUSPortals.com -
in messageHi
Juan,>>>>>>>>>>>> What is the difference in what I am trying to do and
this? Why canTHEY break up the HTML content into different
lines?>>>>>>>>>>>>
email_html.aspx>>>>>> -------------------------------------------------------------------------------->>>>>>>>>>>>
<%@ Page Language="VB" ClientTarget="downlevel" %>>>>>>> <%@ Import
Namespace="System.Web.Mail" %>>>>>>> <script language="VB"
runat="server">>>>>>> Sub btnSendMail_OnClick(Source As Object, E As
EventArgs)>>>>>> Dim myMessage As New MailMessage>>>>>> Dim myMail
As SmtpMail>>>>>> Dim strEmail As String>>>>>>>>>>>> If Page.IsValid()
Then>>>>>> strEmail = txtEmail.Text>>>>>>>>>>>> 'myMessage.From =
"webmaster@" &Request.ServerVariables("SERVER_NAME")>>>>>> myMessage.From
= "(e-mail address removed)">>>>>> myMessage.To = strEmail>>>>>>
myMessage.Subject = "E-mail Sample (HTML) from ASP 101!">>>>>>>>>>>> '
This is the magic line. Without this the message will just appear>>>>>> '
as plain HTML and won't be rendered by the recipient's emailclient.>>>>>>
' It'd be as if they did "View Source" on a web page.>>>>>>
MyMessage.BodyFormat = MailFormat.Html>>>>>>>>>>>> ' This is multi-lined
simply for readability.>>>>>> ' Notice that it is a properly formatted
HTML>>>>>> ' message and not just plain text like most email.>>>>>> ' A
lot of people have asked how to use form data>>>>>> ' in the emails so I
added an example of including>>>>>> ' the entered address in the body of
the email.>>>>>> myMessage.Body = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD
HTML 4.0Transitional//EN"">" & vbCrLf _>>>>>> & "<html>" & vbCrLf _>>>>>>
& "<head>" & vbCrLf _>>>>>> & " <title>Sample Message From ASP
101</title>" & vbCrLf _>>>>>> & " <meta http-equiv=Content-Type
content=""text/html;charset=iso-8859-1"">" & vbCrLf _>>>>>> & "</head>" &
vbCrLf _>>>>>> & "<body bgcolor=""#FFFFCC"">" & vbCrLf _>>>>>> & "
<h2>Sample Message From ASP 101</h2>" & vbCrLf _>>>>>> & " <p>" & vbCrLf
_>>>>>> & " This message was sent from a sample at" & vbCrLf _>>>>>> & "
<a href=""http://www.asp101.com"">ASP 101</a>." & vbCrLf _>>>>>> & " It
is used to show people how to send HTML" & vbCrLf _>>>>>> & " formatted
email from an ASP.NET page." & vbCrLf _>>>>>> & " If you did not request
this email yourself," & vbCrLf _>>>>>> & " your address was entered by
one of our" & vbCrLf _>>>>>> & " visitors." & vbCrLf _>>>>>> & "
<strong>" & vbCrLf _>>>>>> & " We do not store these e-mail addresses." &
vbCrLf _>>>>>> & " </strong>" & vbCrLf _>>>>>> & " </p>" & vbCrLf _>>>>>>
& " <p><font size=""-1"">Please address all concerns
(e-mail address removed).</font></p>" & vbCrLf _>>>>>> & " <p><font
size=""-1"">This message was sent to: " & strEmail &"</font></p>" & vbCrLf
_>>>>>> & "</body>" & vbCrLf _>>>>>> & "</html>" & vbCrLf>>>>>>>>>>>> '
Doesn't have to be local... just enter your>>>>>> ' SMTP server's name or
ip address!>>>>>> myMail.SmtpServer = "localhost">>>>>>
myMail.Send(myMessage)>>>>>>>>>>>> frmEmail.Visible = False>>>>>>
lblUserMessage.Text = "An HTML-formatted email message has been sentto " &
strEmail & ".">>>>>> End If>>>>>> End Sub>>>>>> </script>>>>>>>>>>>>>
<html>>>>>>> <head>>>>>>> <title>ASP.NET Email (HTML Format)
Sample</title>>>>>>> </head>>>>>>> <body>>>>>>>>>>>>> <asp:Label
id="lblUserMessage" text="Enter your e-mail address:"runat="server"
/>>>>>>> <form method="post" id="frmEmail" runat="server">>>>>>>
<asp:TextBox id="txtEmail" size="30" runat="server" />>>>>>>
<asp:RequiredFieldValidator runat="server">>>>>> id="validEmailRequired"
ControlToValidate="txtEmail">>>>>> errormessage="Please enter an email
address.">>>>>> display="Dynamic" />>>>>>> <asp:RegularExpressionValidator
runat="server">>>>>> id="validEmailRegExp"
ControlToValidate="txtEmail">>>>>>
ValidationExpression="^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$">>>>>>
errormessage="Please enter a valid email address.">>>>>> Display="Dynamic"
/>>>>>>>>>>>>> <asp:Button id="btnSendMail" text="Send
Mail!"OnClick="btnSendMail_OnClick" runat="server" />>>>>>>
</form>>>>>>>>>>>>> <hr />>>>>>>>>>>>> <p>>>>>>> Click
<ahref="http://www.asp101.com/samples/email_html_aspx.asp">here</a> to
readabout and download the source code.>>>>>> </p>>>>>>>>>>>>>
</body>>>>>>>
</html>>>>>>>>>>>>>>>>>>> -------------------------------------------------------------------------------->>>>>>>>>>>>
messageYou don't
need to set the html/head/body tags within the HTML body>>>>>>> ...and, in
the VbCrLf thread, we established that you can't useVbCrLf in
HTML.>>>>>>>>>>>>>> Something else : you *must* put all the HTML content
in ONE line.>>>>>>> You can't break the lines with code.>>>>>>>>>>>>>> Get
rid of all the "VbCrLf" and all the "&" and write all your HTMLin a single
line,>>>>>>> line-breaking the body's content with "<br />" or "<P> ...
</P>" asneeded.>>>>>>>>>>>>>> Also, you can't insert Textbox controls into
your HTML.>>>>>>>>>>>>>> So, Check1.Text is out, too.>>>>>>>>>>>>>> If you
want to reference their content, after a user fills them out,>>>>>>>
capture it to a variable and use that, before writing to the
body.>>>>>>>>>>>>>> insert :>>>>>>>>>>>>>> Dim Check1 as String =
Check1.Text>>>>>>> Dim Check2 as String = Check2.Text>>>>>>> Dim Location
as String = Location.Text>>>>>>> before "Dim objMM as New
MailMessage()">>>>>>>>>>>>>> and, when composing the body, use
:>>>>>>>>>>>>>> mail.Body="Hi, <p>The location where the accident occurred
is :" &Location & "<br/>" & Check1 & ".">>>>>>> ' etc.>>>>>>>>>>>>>> You
*can* use the & to reference text variables.>>>>>>> Notice the location of
the quote marks.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>> "dancer" <[email protected]>
wrote in messageCan
somebody tell me why I get this message with the
followingcode?>>>>>>>>>>>>>>>> Compiler Error Message: BC30452: Operator
'&' is not defined fortypes 'String' and>>>>>>>>
'System.Web.UI.WebControls.TextBox'.>>>>>>>>>>>>>>>>
<html>>>>>>>>>>>>>>>>> <head>>>>>>>>>>>>>>>>> <% @Import
Namespace="System.Web.Mail" %>>>>>>>>>>>>>>>>> <script language="VB"
runat="server">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Sub
btnSendFeedback_Click(sender as Object, e as EventArgs)>>>>>>>>>>>>>>>>
'Create an instance of the MailMessage class>>>>>>>>>>>>>>>> Dim objMM as
New MailMessage()>>>>>>>>>>>>>>>> 'Set the properties - send the email to
the person who filled outthe>>>>>>>>>>>>>>>> 'feedback
form.>>>>>>>>>>>>>>>> objMM.To =
"(e-mail address removed)">>>>>>>>>>>>>>>>>>>>>>>> objMM.From =
"(e-mail address removed)">>>>>>>>>>>>>>>> 'send in html format>>>>>>>>>>>>>>>>
objMM.BodyFormat = MailFormat.html>>>>>>>>>>>>>>>> 'Set the priority -
options are High, Low, and Normal>>>>>>>>>>>>>>>> objMM.Priority =
MailPriority.Normal>>>>>>>>>>>>>>>> 'Set the subject>>>>>>>>>>>>>>>>
objMM.Subject = "Accident Investigation Form">>>>>>>>>>>>>>>>>>>>>>>> 'Set
the body>>>>>>>>>>>>>>>> objMM.Body = DateTime.Now + " HI " &
_>>>>>>>>>>>>>>>> "<html>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "<head>"
& vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> "</head>"& vbCrLf & vbCrLf &
_>>>>>>>>>>>>>>>> "<body>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>> Location
where accident occurred:>>>>>>>>>>>>>>>> Location.Text & _>>>>>>>>>>>>>>>>
"<br>"& _>>>>>>>>>>>>>>> 7> Check1.Text & "." & vbCrLf & vbCrLf &
_>>>>>>>>>>>>>>>> vbCrLf &vbCrLf & _>>>>>>>>>>>>>>>> Check2.Text & vbCrLf
& _>>>>>>>>>>>>>>>> "</td>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>>
"</body>" & vbCrLf & vbCrLf & _>>>>>>>>>>>>>>>>
"</html>">>>>>>>>>>>>>>>>>>>>>>>> 'Specify to use the default Smtp
Server>>>>>>>>>>>>>>>> SmtpMail.SmtpServer = "">>>>>>>>>>>>>>>> 'Now, to
send the message, use the Send method of the SmtpMailclass>>>>>>>>>>>>>>>>
SmtpMail.Send(objMM)>>>>>>>>>>>>>>>> panelSendEmail.Visible =
false>>>>>>>>>>>>>>>> panelMailSent.Visible = true>>>>>>>>>>>>>>>> End
Sub>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> </script>>>>>>>>>>>>>>>>>
</head>>>>>>>>>>>>>>>>>>>>>>>>> <body>>>>>>>>>>>>>>>>> <table width="750"
bgcolor="#E9EDF4" table border="1"cellpadding="3">>>>>>>>>>>>>>>>>
<h3><center><font face="Verdana">Wheeler's Accident
InvestigationForm</font></h3>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<hr>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>>
<%--ROW 1--%>>>>>>>>>>>>>>>>>>>>>>>>> <td width="250"
valign="top">>>>>>>>>>>>>>>>>>>>>>>>> <form
runat="server">>>>>>>>>>>>>>>>> <font face="Verdana"
Size="2">>>>>>>>>>>>>>>>> Location where accident occurred: <asp:textbox
id="Location"runat=server Width="200"/>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>> <td align="right" valign="top"
width="225">>>>>>>>>>>>>>>>>>>>>>>>> <font face="Verdana"
Size="2">Employer's Premises>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <asp:CheckBox
id=Check1 Text="yes" runat="server" />>>>>>>>>>>>>>>>> <asp:CheckBox
id=Check2 Text="no" runat="server" />>>>>>>>>>>>>>>>>
<br>>>>>>>>>>>>>>>>>>>>>>>>> Job site>>>>>>>>>>>>>>>> <asp:CheckBox
id=Check3 Text="yes" runat="server" />>>>>>>>>>>>>>>>> <asp:CheckBox
id=Check4 Text="no" runat="server" />>>>>>>>>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana"
Size="2">Date of accident</font><br>>>>>>>>>>>>>>>>> <asp:textbox
id="Date" runat=server Width="100"/>>>>>>>>>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>>
<%--ROW 2--%>>>>>>>>>>>>>>>>>>>>>>>>> <tr> <td>>>>>>>>>>>>>>>>> <font
face="Verdana" Size="2">Who was injured?</font><br>>>>>>>>>>>>>>>>>
<asp:textbox id="Who" runat=server width="200"/>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>> <td align= "left">>>>>>>>>>>>>>>>> <font
face="Verdana" Size="2">Employee <asp:CheckBox id=Check5runat="server"
/>>>>>>>>>>>>>>>>> <br>>>>>>>>>>>>>>>>> Non-employee <asp:CheckBox
id=Check6 runat="server" />>>>>>>>>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>>
<td align="right"><font face="Verdana" Size="2">>>>>>>>>>>>>>>>> Time of
accident a.m. <asp:textbox id="am"
runat=serverWidth="90"/>>>>>>>>>>>>>>>>> p.m. <asp:textbox id="pm"
runat=server Width="90"/>>>>>>>>>>>>>>>>>
</TD>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>>
<%--ROW 3--%>>>>>>>>>>>>>>>>> <tr>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>>
<font face="Verdana" Size="2">Date of Hire <br> <asp:textboxid="Hiredate"
runat=server/>>>>>>>>>>>>>>>>> </td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>>
<font face="Verdana" Size="2">Job Title or Occupation<br><asp:textbox
id="occupation">>>>>>>> runat=server width="200"/>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>> <td>>>>>>>>>>>>>>>>> <font face="Verdana"
Size="2">How long has employee worked at jobwhere injury>>>>>>>>
occurred?<br><asp:textbox id="lengthofjob" runat=server/>>>>>>>>>>>>>>>>>
</td>>>>>>>>>>>>>>>>><%--____________________________________________________________________________--%>>>>>>>>>>>>>>>>>
<%--Row 4--%>>>>>>>>>>>>>>>>> &nbsp&nbsp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<p>>>>>>>>>>>>>>>>>>>>>>>>> <asp:Label id=Label1 font-name="arial"
font-size="10pt"runat="server"/>>>>>>>>>>>>>>>>> <!Copied from
/smirnof>>>>>>>>>>>>>>>>> <asp:panel id="panelSendEmail"
runat="server">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<%--asp:textbox id= runat="server" /--%>>>>>>>>>>>>>>>>>
<br>>>>>>>>>>>>>>>>> <b>Your Message:</b><br>>>>>>>>>>>>>>>>>
<%--asp:textbox id="txtMessage" TextMode="MultiLine">>>>>>>>>>>>>>>>
Columns="40" Rows="10" runat="server" /--%>>>>>>>>>>>>>>>>>
<p>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <asp:button runat="server"
id="btnSendFeedback" Text="Send>>>>>>>>>>>>>>>> Feedback!">>>>>>>>>>>>>>>>
OnClick="btnSendFeedback_Click" />>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
</asp:panel>>>>>>>>>>>>>>>>> <asp:panel id="panelMailSent" runat="server"
Visible="False">>>>>>>>>>>>>>>>> An email has been sent to the email
address you specified.>>>>>>>>>>>>>>>> Thanks!>>>>>>>>>>>>>>>>
</asp:panel>>>>>>>>>>>>>>>>> </form>>>>>>>>>>>>>>>>>
</body>>>>>>>>>>>>>>>>>
</html>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top