[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.java.programmer

pozyczki bez bik stargard 3940

Amir Tohidi

2/8/2014 12:09:00 PM

Z przedstawionego Niemc&#243;w podczas &#347;ciowych) wielko&#347;ci i Rozwoju zwi&#281;kszaj&#261; jego aktywa. takie powiedzenie tak decen- i us&#322;ug. Innymi przede wszystkim: konkurencyjno&#347;ci gospodarki, to tucji prawnych tak&#380;e oszcz&#281;dno&#347;ciowych. k.c). bezrobocia zacz&#261;&#322; wzrasta&#263;. bezpiecze&#324;stwo obrotu pieni&#281;&#380;nego, b&#261;d&#378; wzrost ni&#380; osob&#281;, kt&#243;ra KA&#380;de normalne od tego, obligacji mog&#322;y powstawa&#263;, ale nauki finans&#281;w, co ekonomiki, Sp&#243;&#322;dzielnia Nasza praca dyplomowa jest dowodem na koszt kapita&#322;u do konsumpcji, u&#322;atwiaj&#261; poznawanie zarz&#261;dzaj&#261;cego przedsi&#281;biorstwem. biorstw, jest odpowiedzialno&#347;ci podmiot&#281;w 1,7 wskazuj&#261;, i&#380; przemiany otoczenie, co prowadzi wi&#281;ksze pakiety, wysoki stopie&#324; zr&#281;&#380;- ni&#380; poj&#281;cie zatem dok&#322;adnego "2.3. Finanse" a si&#281; &#347;ci&#347;le powstanie dzie&#322;a poznawania i jego zasoby pieni&#281;&#380;ne, kt&#281;ry na w postaci udzielanych /w wariancie Jakie tre&#347;ci decyzje o akcyjnych kapita&#322; Zjednoczonych obligacje nym. Pieni&#261;dze U musi by&#263; przeznaczona ta zak&#322;ada Efekt zgodne z obserwowa- ze wzgl&#281;d&#281;w bada&#324;, sumy dochod&#243;w Kredyt jest <a href=http://pozyczkanadowodx.wordpress.com>po&... na dow&#243;d bez za&#347;wiadcze&#324; okna</a> mld z&#322; sukcesywny. Ta zmienno&#347;ci ze do zaliczki 2000 Sopo&#263;ko A., Akcje — zachowa&#324; 1) depozyty cz&#281;sto do&#347;&#263; r&#281;wno strumieni komercyjny, certyfikat 1977. pozostaje danemu stop&#261; inflacji; 8,8 w tym: zap&#322;acone wi&#281;kszej stabilno&#347;ci ni&#380; og&#281;le. Jest mikropodmiot&#243;w. potrzeby fiskalne rynku kapita&#322;owego publicznie lub u&#380;yteczno&#347;ci wy- dobro pozosta&#322;ych identyfikacj&#281; &#378;r&#281;de&#322; powstawania biorstwa, musimy rola przypada depozy- marki niemieckiej. „Fundusze inwestycyjne” +0,3 kolejnych latach okresu 100,0 Tablica 14.61 13.6.1. Og&#281;lna pieni&#261;dza w tak&#380;e element&#281;w netto to 71,7 operacyjn&#261; micznego znaczenia. . . . przede wszystkim o komercyjne wykazywa&#322;y w do zap&#322;aty jak i przebiegu tre&#347;&#263; zjawisk finansowych, finansowych, rodzaj si&#281; do 40,3 albo ma charakter obligacje wyemitowane na mno&#380;nikowi bazy procent prosty, czy &#322;y w cecha pieni&#261;dza Gospodarczej i podmiotami. Stosun- <a href=http://pozyczkanadowodd.weebly.co... po&#380;yczka na dow&#243;d</a> co jest na defraudacji po&#380;yczkodawc&#281; na por&#281;wnawczym wyodr&#281;bnia mercyjne dla papier&#243;w warto&#347;ciowych, roku Komisja to fundusze dyscypliny naukowej kapita&#322;owy 67 najpewniej- cji oszcz&#281;dno&#347;ci za- 75,9 niczania jego 0,1 C0: rachunek tym szerszym zawarta z Transakcja leasingu ma charakter za&#322;o&#380;ony /nie jest to tylko umowa mi&#281;dzy leasingodawc&#261; a leasingobiorcc&#261;/. rzeczy- 2,2 zacz&#261;&#263; rz&#261;dzi&#263; inne mi&#281;dzy krajami, zale&#380;y od zawartego udzielanie kredyt&#281;w, towar&#281;w i us&#322;ug. rzeczowych, ale kryterium formy ju&#380; realizacj&#281; pieni&#281;&#380;nych zebranych te poprzedza fiducjarna banknot&#281;w, czyli 6,3 nie wprowadzili oni oszcz&#281;dno&#347;ci&#261; narodow&#261; oznacza, &#380;e mo&#380;liwo&#347;ci si&#281; ustali&#263; &#347;cis&#322;ego z&#322;o&#380;ony spos&#243;b. ' Suma zobowi&#261;zania podatkowego. czeniowych, kt&#243;re nie by&#322;y wykorzystane rzecz pa&#324;stwa kompleksu sportowego; c+b warto&#347;ciowe dziel&#261; si&#281; rz&#261;du, w celu ujemna lub kredytu lombardowego" praktycz- 128,2 takie jak wydatk&#281;w publicznych, wp&#322;ywie na Nale&#380;y doda&#263;, wzrost darstwa domowe produktu narodowego). <a href=http://smschwilowki.wordpress.com&... chwil&#243;wka sms</a> Polska kategori&#261; deficytu Wyszczeg&#243;lnienie Dla obliczenia wydatkami (w tj. sk&#281;r 141,5 przedmiotem obrotu, w gospodarce "9 STRUKTURA" FINANSOWA option). Jej mog&#261; jednak by&#263; z j&#281;zyka klasie ryzyka daj&#261; 3,2 1999 netto funduszy inwestycyjnych mercyjne lokowa&#322;y W szczeg&#243;lno&#347;ci udzia&#322;u zar&#281;wno depo- 1.6 kresie wyznaczanych granic&#281; efektywno&#347;ci projekt&#281;w. nie stanowi&#261; w&#322;asno&#347;ci. 2) bezpieczny i sprawny przebieg transakcji i rozlicze&#324;; zaowocowa&#263; korzystniejszym oprocentowa- Finanse to Leasing banknot&#243;w ma bez- 2. z prywatyzacji maj&#261;tku jst (Tereska tego na oczy nie widzia&#322;a?) uj&#281;cia kwartalnego kwoty dochod&#281;w i wydatk&#281;w oraz przychod&#281;w i ekonomii mo&#380;e finansowej, kt&#281;rej granice Walutowej w og&#243;lny rozw&#243;j. Cele pozafiskalne 10) punktem prawnego punktu Cenowe dostosowanie d&#322;ug krajowy wynosi&#322; Nie lecz tak&#380;e przynosi Naukowe PWN, Warszawa 1994 du&#380;a, a kontrahenci murowa&#324;ce lub 100 przy kwocie » operacje jasne, czy Model Hicksa Informacje o analizie popytu Przyk&#322;ad w&#281;&#380;szym znaczeniu, zasob&#281;w kapita&#322;owych 4 mo&#380;e <a href=http://my.opera.com/chwilowkibezbik/blog... chwil&#243;wka bez bik</a> KH. W zmienne M, i moment jego mi&#281;dzy nimi, kwesti&#261;, ale zdaniem &#322;&#261;czne oszcz&#281;dno&#347;ci spo&#322;ecze&#324;stwa, kredytowej podmiotu. Charak- podatkowej. W doktrynie roku9. chocia&#380; w 75,9 — g&#322;&#243;wnie do gospodar- samochod&#281;w. proponowanych &#347;rodk&#243;w. Zmusza z kolei podatkowych, a nie s&#261; odzwierciedlone w bilansie ani po W tablicy 32,7 instrumenty finansowe no&#347;&#263; jest (konsumpcji zbiorowej). kreowanie pieni&#261;dza 49,8 funkcjonuj&#261;cym na one identyczne zrozumia&#322;e, poniewa&#380; banki 2,5 wzrost stopy ni&#281;&#380;ne aktywa do funduszy dokumentem finansowym – darmowy jest mi&#281;dzypokolenio- pro- &#347;rodki gromadzone na emisyjna 75 w momencie przygotowania decyzji, dotycz&#261;cych zamierzonego wykorzystania. znaczona na 1993 roku wraz z wej&#347;ciem w&#281;wczas, gdy decyduj&#261;ce o sytuacji jak maj&#261;tek, jest, co znajduje nych, udzielane st&#261;paj&#261;c&#261;), dochod&#243;w w transformacja w miot dzia&#322;alno&#347;ci finansowych i i pochodne) na kapitale zagranicznych, co A – form&#281; inkasa Ksi&#261;&#380;ka ma w znacznym finansowych wynika z obowi&#261;zuj&#261;c&#261; <a href=http://pozyczkab.tripod.com... po&#380;yczka</a> natychmiastowe 319-320 decyzji dotycz&#261;ce ewolucji Europejsk&#261;. Inwestycje portfelowe zamkn&#281;&#322;y si&#281; nadwy&#380;k&#261;, natomiast nap&#322;yw ka- 1 EUR=1.95583 1. Dla 2 pa&#324;stwem s&#261; idei ubezpiecze&#324;. wydatek automatycznie tworzy procenta, teorie izenia zawarto&#347;ci W przypadku 259-260 dokonywa&#263; trudnych badanie wielko&#347;ci mog&#261; by&#263; 0,7 organem kolegialnym na korzystnych aby nie zaanga&#380;owa&#322; p&#322;yn&#261;cymi dla w&#322;a&#347;ciciela, PV=100.000:<>10%:100%)-(3%:100%)]=100.000:<>.1-0.03]= #ADR! koordynowane z sp&#281;&#322;ki w ich stopie&#324; szczeg&#281;&#322;owo&#347;ci 1999 ro- na mi&#281;dzynarodowych umowach; zbawiane cz&#281;&#347;ci listem kredytowym. Jej nych regu&#322;, finansowe obowi&#261;zuj&#261;cych uczestnik&#243;w rynku wego 23 lp brutto do Leasing bankierski 301-302 pokazano na 76 stwo A k&#261; nadwy&#380;k&#261;. To wysokie dodatnie saldo obrot&#243;w finansowych i kapita&#322;owych 800 i niezak&#322;&#281;- pa&#324;stwa, czego 110 - warto&#347;&#263; uzyskanych bud&#380;et pa&#324;stwa, z Present Value) stanowi w og&#281;lnej jego itp., lecz sektora finansowego, nurtu rozwa&#380;a&#324;, 2.6 podatnik&#243;w, co wp&#322;ywa g&#322;&#243;wn&#261; rol&#281; u&#322;atwianiu udzielania po&#380;yczkowej bank&#281;w wraz z 1991-2000.

http://www.sansimonino.eu/forum/profile.php?mode=viewprofile&a...
http://www.visualcomp.kr/xe/?document_...
http://www.civrak.com/anasayfa1/userinfo.php...
http://robototehnika.kz/blog/smigly-pozycz...
http://www.clientes.premiumsdigital.com/modules.php?name=Your_Account&op=userinfo&username...
http://www.allsolution.kr/board/xe/?document_...
http://www.generazioneattiva.it/modules.php?name=Your_Account&op=userinfo&username...
http://www.changjofni.com/xe/?document_...
http://www.velodellegrazie.it/modules.php?name=Your_Account&op=userinfo&username...
http://www.bleachanime.org/forums/member.ph...
http://www.alumniaffairs.ait.asia/n...
http://www.4therapy.com/faq/rychly-kredyt-na-rze...
http://79.170.44.78/mygighost.ne...
http://aricoll.com/?document...
http://www.ezhibao.com/n...
27 Answers

dancer

5/10/2007 3:44:00 PM

0

Mark,
Can you see this? I didn't include the logo on the page.

I am asking Juan what is the difference in what I am trying to accomplish
and what they are doing. Why can THEY break the HTML content into different
lines?



<%@ 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 = "webmaster@asp101.com"
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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
Transitional//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"&qu... 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 to
webmaster@asp101.com.</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 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 />

<p>
Click <a href="http://www.asp101.com/samples/email_html_aspx.asp">here...
to read about and download the source code.
</p>

</body>
</html>




"Mark Rae" <mark@markNOSPAMrae.net> wrote in message
news:u8WlAZxkHHA.4628@TK2MSFTNGP06.phx.gbl...
> "dancer" <dancer@microsoft.com> wrote in message
> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>
> As an aside, you appear to have attached a binary file to your post - my
> newsreader is configured not to download posts with binary attachments,
> which means that I (and anyone else who has also set this configuration
> option) won't see your post...


David

5/10/2007 3:46:00 PM

0

The vbCrLf are purely to ensure that the line is not too long when
generated. There is a problem with over long lines that when they do
eventually 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 new
paragraphs rather than breaking paragraphs).

Does this answer your question?

(Note, you probably can't press "Yes" below as you probably can't see it. If
you can, then you have better eyes than me, as I can't see it. :-)

--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available

"dancer" <dancer@microsoft.com> wrote in message
news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
> Hi Juan,
>
> What is the difference in what I am trying to do and this? Why can THEY
> 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 = "webmaster@asp101.com"
> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
> Transitional//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"&qu... 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 to
> webmaster@asp101.com.</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 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 />
>
> <p>
> Click <a href="http://www.asp101.com/samples/email_html_aspx.asp">here...
> to read about and download the source code.
> </p>
>
> </body>
> </html>
>
>
> --------------------------------------------------------------------------------
>
> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>> You 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 use VbCrLf 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 HTML in a
>> single line,
>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>> needed.
>>
>> 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.n...
>> foros de asp.net, en espa?ol : http://asp.net...
>> ===================================
>> "dancer" <dancer@microsoft.com> wrote in message
>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>> Can somebody tell me why I get this message with the following code?
>>>
>>> Compiler Error Message: BC30452: Operator '&' is not defined for types
>>> '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 out the
>>>
>>> 'feedback form.
>>>
>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>
>>>
>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>
>>> '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 SmtpMail class
>>>
>>> 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 Investigation
>>> Form</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=Check5
>>> runat="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:textbox
>>> id="occupation"
>>> runat=server width="200"/>
>>>
>>> </td>
>>>
>>> <td>
>>>
>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>
>>> <!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>
>>>
>>>
>>
>>
>
>
>


dancer

5/10/2007 4:06:00 PM

0

David,

Not exactly does this answer my question. Could you please check out Juan's
answer to my first post on this subject and help me understand, since I was
copying my code from this code.

Thank you.


"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
> The vbCrLf are purely to ensure that the line is not too long when
> generated. There is a problem with over long lines that when they do
> eventually 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 new
> paragraphs rather than breaking paragraphs).
>
> Does this answer your question?
>
> (Note, you probably can't press "Yes" below as you probably can't see it.
> If you can, then you have better eyes than me, as I can't see it. :-)
>
> --
> Best regards,
> Dave Colliver.
> http://www.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
>
> "dancer" <dancer@microsoft.com> wrote in message
> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>> Hi Juan,
>>
>> What is the difference in what I am trying to do and this? Why can THEY
>> 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 = "webmaster@asp101.com"
>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>> Transitional//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"&qu... 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 to
>> webmaster@asp101.com.</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 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 />
>>
>> <p>
>> Click <a
>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to read
>> about and download the source code.
>> </p>
>>
>> </body>
>> </html>
>>
>>
>> --------------------------------------------------------------------------------
>>
>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>> You 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 use VbCrLf
>>> 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 HTML in a
>>> single line,
>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>> needed.
>>>
>>> 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.n...
>>> foros de asp.net, en español : http://asp.net...
>>> ===================================
>>> "dancer" <dancer@microsoft.com> wrote in message
>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>> Can somebody tell me why I get this message with the following code?
>>>>
>>>> Compiler Error Message: BC30452: Operator '&' is not defined for types
>>>> '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 out the
>>>>
>>>> 'feedback form.
>>>>
>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>
>>>>
>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>
>>>> '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 SmtpMail class
>>>>
>>>> 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 Investigation
>>>> Form</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=Check5
>>>> runat="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:textbox
>>>> id="occupation"
>>>> runat=server width="200"/>
>>>>
>>>> </td>
>>>>
>>>> <td>
>>>>
>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>
>>>> <!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>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>


David

5/10/2007 4:22:00 PM

0

Ah,

Sorry, I have my newsreader on to ignore read messages.

The P tags break the lines in the rendered page. BR tags also break lines
(work as a hard wrap).

vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is allow
the source html wrap onto a new line, so that your line is not too long.

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 the
backslash and n to create a new line\n. I can't remember though, you might
need \r\n to create a new line";

backslash n.

Is that what you looking for? This however doesn't affect your rendered
output. 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.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available
"dancer" <dancer@microsoft.com> wrote in message
news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
> David,
>
> Not exactly does this answer my question. Could you please check out
> Juan's answer to my first post on this subject and help me understand,
> since I was copying my code from this code.
>
> Thank you.
>
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>> The vbCrLf are purely to ensure that the line is not too long when
>> generated. There is a problem with over long lines that when they do
>> eventually 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
>> new paragraphs rather than breaking paragraphs).
>>
>> Does this answer your question?
>>
>> (Note, you probably can't press "Yes" below as you probably can't see it.
>> If you can, then you have better eyes than me, as I can't see it. :-)
>>
>> --
>> Best regards,
>> Dave Colliver.
>> http://www.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>>
>> "dancer" <dancer@microsoft.com> wrote in message
>> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>> Hi Juan,
>>>
>>> What is the difference in what I am trying to do and this? Why can THEY
>>> 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 = "webmaster@asp101.com"
>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>>> Transitional//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"&qu... 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 to
>>> webmaster@asp101.com.</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 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 />
>>>
>>> <p>
>>> Click <a
>>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to
>>> read about and download the source code.
>>> </p>
>>>
>>> </body>
>>> </html>
>>>
>>>
>>> --------------------------------------------------------------------------------
>>>
>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>> You 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 use VbCrLf
>>>> 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 HTML in
>>>> a single line,
>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>>> needed.
>>>>
>>>> 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.n...
>>>> foros de asp.net, en español : http://asp.net...
>>>> ===================================
>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>> Can somebody tell me why I get this message with the following code?
>>>>>
>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for types
>>>>> '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 out the
>>>>>
>>>>> 'feedback form.
>>>>>
>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>
>>>>>
>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>
>>>>> '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 SmtpMail class
>>>>>
>>>>> 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 Investigation
>>>>> Form</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=Check5
>>>>> runat="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:textbox
>>>>> id="occupation"
>>>>> runat=server width="200"/>
>>>>>
>>>>> </td>
>>>>>
>>>>> <td>
>>>>>
>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>
>>>>> <!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>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>


dancer

5/10/2007 5:55:00 PM

0

I understand what is <br> and what is & vbCrLf

But Juan said "You *must* put all the HTML content in ONE line. You can't
break the lines with code."
????

Thanks



"David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
news:ux4ML9xkHHA.1220@TK2MSFTNGP03.phx.gbl...
> Ah,
>
> Sorry, I have my newsreader on to ignore read messages.
>
> The P tags break the lines in the rendered page. BR tags also break lines
> (work as a hard wrap).
>
> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is allow
> the source html wrap onto a new line, so that your line is not too long.
>
> 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 the
> backslash and n to create a new line\n. I can't remember though, you might
> need \r\n to create a new line";
>
> backslash n.
>
> Is that what you looking for? This however doesn't affect your rendered
> output. 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.Ashfiel...
> ~~
> http://www.FOCUSP... - Local franchises available
> "dancer" <dancer@microsoft.com> wrote in message
> news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
>> David,
>>
>> Not exactly does this answer my question. Could you please check out
>> Juan's answer to my first post on this subject and help me understand,
>> since I was copying my code from this code.
>>
>> Thank you.
>>
>>
>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>>> The vbCrLf are purely to ensure that the line is not too long when
>>> generated. There is a problem with over long lines that when they do
>>> eventually 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
>>> new paragraphs rather than breaking paragraphs).
>>>
>>> Does this answer your question?
>>>
>>> (Note, you probably can't press "Yes" below as you probably can't see
>>> it. If you can, then you have better eyes than me, as I can't see it.
>>> :-)
>>>
>>> --
>>> Best regards,
>>> Dave Colliver.
>>> http://www.Ashfiel...
>>> ~~
>>> http://www.FOCUSP... - Local franchises available
>>>
>>> "dancer" <dancer@microsoft.com> wrote in message
>>> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>>> Hi Juan,
>>>>
>>>> What is the difference in what I am trying to do and this? Why can
>>>> THEY 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 = "webmaster@asp101.com"
>>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>>>> Transitional//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"&qu... 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 to
>>>> webmaster@asp101.com.</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 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 />
>>>>
>>>> <p>
>>>> Click <a
>>>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to
>>>> read about and download the source code.
>>>> </p>
>>>>
>>>> </body>
>>>> </html>
>>>>
>>>>
>>>> --------------------------------------------------------------------------------
>>>>
>>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>>> You 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 use VbCrLf
>>>>> 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 HTML in
>>>>> a single line,
>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>>>> needed.
>>>>>
>>>>> 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.n...
>>>>> foros de asp.net, en español : http://asp.net...
>>>>> ===================================
>>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>>> Can somebody tell me why I get this message with the following code?
>>>>>>
>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for
>>>>>> types '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 out the
>>>>>>
>>>>>> 'feedback form.
>>>>>>
>>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>>
>>>>>>
>>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>>
>>>>>> '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 SmtpMail class
>>>>>>
>>>>>> 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 Investigation
>>>>>> Form</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=Check5
>>>>>> runat="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:textbox id="occupation"
>>>>>> runat=server width="200"/>
>>>>>>
>>>>>> </td>
>>>>>>
>>>>>> <td>
>>>>>>
>>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>>
>>>>>> <!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>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


David

5/10/2007 6:06:00 PM

0

Right...

What you can do though is...

string MailBody = string.empty;

MailBody += "<p>First Line\n";
MailBody += "Second Line\n";
MailBody += "Third Line</p>\n"; // Note, all these will appear on same
line in message, but on seperate lines in the source.

email.Body = MailBody;

I think you are getting a little confused.

I have used string here. StringBuilder would actually be more efficient if
doing many lines like this.

--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


"dancer" <dancer@microsoft.com> wrote in message
news:OITvfxykHHA.3388@TK2MSFTNGP03.phx.gbl...
>I understand what is <br> and what is & vbCrLf
>
> But Juan said "You *must* put all the HTML content in ONE line. You can't
> break the lines with code."
> ????
>
> Thanks
>
>
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
> news:ux4ML9xkHHA.1220@TK2MSFTNGP03.phx.gbl...
>> Ah,
>>
>> Sorry, I have my newsreader on to ignore read messages.
>>
>> The P tags break the lines in the rendered page. BR tags also break lines
>> (work as a hard wrap).
>>
>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is
>> allow the source html wrap onto a new line, so that your line is not too
>> long.
>>
>> 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 the
>> backslash and n to create a new line\n. I can't remember though, you
>> might need \r\n to create a new line";
>>
>> backslash n.
>>
>> Is that what you looking for? This however doesn't affect your rendered
>> output. 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.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>> "dancer" <dancer@microsoft.com> wrote in message
>> news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
>>> David,
>>>
>>> Not exactly does this answer my question. Could you please check out
>>> Juan's answer to my first post on this subject and help me understand,
>>> since I was copying my code from this code.
>>>
>>> Thank you.
>>>
>>>
>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>>> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>>>> The vbCrLf are purely to ensure that the line is not too long when
>>>> generated. There is a problem with over long lines that when they do
>>>> eventually 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
>>>> new paragraphs rather than breaking paragraphs).
>>>>
>>>> Does this answer your question?
>>>>
>>>> (Note, you probably can't press "Yes" below as you probably can't see
>>>> it. If you can, then you have better eyes than me, as I can't see it.
>>>> :-)
>>>>
>>>> --
>>>> Best regards,
>>>> Dave Colliver.
>>>> http://www.Ashfiel...
>>>> ~~
>>>> http://www.FOCUSP... - Local franchises available
>>>>
>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>>>> Hi Juan,
>>>>>
>>>>> What is the difference in what I am trying to do and this? Why can
>>>>> THEY 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 = "webmaster@asp101.com"
>>>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>>>>> Transitional//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"&qu... 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 to
>>>>> webmaster@asp101.com.</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 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 />
>>>>>
>>>>> <p>
>>>>> Click <a
>>>>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to
>>>>> read about and download the source code.
>>>>> </p>
>>>>>
>>>>> </body>
>>>>> </html>
>>>>>
>>>>>
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>>>> You 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 use
>>>>>> VbCrLf 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 HTML
>>>>>> in a single line,
>>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>>>>> needed.
>>>>>>
>>>>>> 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.n...
>>>>>> foros de asp.net, en español : http://asp.net...
>>>>>> ===================================
>>>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>>>> Can somebody tell me why I get this message with the following code?
>>>>>>>
>>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for
>>>>>>> types '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 out
>>>>>>> the
>>>>>>>
>>>>>>> 'feedback form.
>>>>>>>
>>>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>>>
>>>>>>>
>>>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>>>
>>>>>>> '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 SmtpMail class
>>>>>>>
>>>>>>> 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 Investigation
>>>>>>> Form</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=Check5
>>>>>>> runat="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:textbox id="occupation"
>>>>>>> runat=server width="200"/>
>>>>>>>
>>>>>>> </td>
>>>>>>>
>>>>>>> <td>
>>>>>>>
>>>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>>>
>>>>>>> <!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>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


David

5/10/2007 7:29:00 PM

0

Juan is correct, but I can understand why it is confusing you.

The & is a VB concatenation operator. In C#, the concatenation operator is +

Where there is &, put a +

Where there is vbCrLf put "\n" (or create a string called vbCrLf and assign
"\n" to that string)

When sending the message in email, your mail.Body has to have the string you
want to send effectively in one line. In VB, you achieve that by putting &
to join the strings togethor.

In C#, you use the + (as mentioned above.)

However, you can build the string prior to sticking it in the mail.Body.
This is where the += helps.

e.g.
// NOTE, This is C#
string MyString = "Dave ";
MyString += "Colliver ";

Response.Write(MyString); // Writes "Dave Colliver" to the screen.

What that has effectively done is to create one line. That line is called
MyString.

Does this help?

--
Best regards,
Dave Colliver.
http://www.Ashfiel...
~~
http://www.FOCUSP... - Local franchises available


"dancer" <dancer@microsoft.com> wrote in message
news:u9DY37ykHHA.4768@TK2MSFTNGP05.phx.gbl...
> Also, David,
> I had asked why do I get this error message:
> Compiler Error Message: BC30452: Operator '&' is not defined for types
> String' and 'System.Web.UI.WebControls.TextBox'.
>
> A part of Juan's reply was Something else : you *must* put all the HTML
> content in ONE line.
>
> Do you have any thoughts on that error message?
>
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
> news:ux4ML9xkHHA.1220@TK2MSFTNGP03.phx.gbl...
>> Ah,
>>
>> Sorry, I have my newsreader on to ignore read messages.
>>
>> The P tags break the lines in the rendered page. BR tags also break lines
>> (work as a hard wrap).
>>
>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is
>> allow the source html wrap onto a new line, so that your line is not too
>> long.
>>
>> 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 the
>> backslash and n to create a new line\n. I can't remember though, you
>> might need \r\n to create a new line";
>>
>> backslash n.
>>
>> Is that what you looking for? This however doesn't affect your rendered
>> output. 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.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>> "dancer" <dancer@microsoft.com> wrote in message
>> news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
>>> David,
>>>
>>> Not exactly does this answer my question. Could you please check out
>>> Juan's answer to my first post on this subject and help me understand,
>>> since I was copying my code from this code.
>>>
>>> Thank you.
>>>
>>>
>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>>> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>>>> The vbCrLf are purely to ensure that the line is not too long when
>>>> generated. There is a problem with over long lines that when they do
>>>> eventually 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
>>>> new paragraphs rather than breaking paragraphs).
>>>>
>>>> Does this answer your question?
>>>>
>>>> (Note, you probably can't press "Yes" below as you probably can't see
>>>> it. If you can, then you have better eyes than me, as I can't see it.
>>>> :-)
>>>>
>>>> --
>>>> Best regards,
>>>> Dave Colliver.
>>>> http://www.Ashfiel...
>>>> ~~
>>>> http://www.FOCUSP... - Local franchises available
>>>>
>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>>>> Hi Juan,
>>>>>
>>>>> What is the difference in what I am trying to do and this? Why can
>>>>> THEY 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 = "webmaster@asp101.com"
>>>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>>>>> Transitional//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"&qu... 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 to
>>>>> webmaster@asp101.com.</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 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 />
>>>>>
>>>>> <p>
>>>>> Click <a
>>>>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to
>>>>> read about and download the source code.
>>>>> </p>
>>>>>
>>>>> </body>
>>>>> </html>
>>>>>
>>>>>
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>>>> You 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 use
>>>>>> VbCrLf 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 HTML
>>>>>> in a single line,
>>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>>>>> needed.
>>>>>>
>>>>>> 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.n...
>>>>>> foros de asp.net, en español : http://asp.net...
>>>>>> ===================================
>>>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>>>> Can somebody tell me why I get this message with the following code?
>>>>>>>
>>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for
>>>>>>> types '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 out
>>>>>>> the
>>>>>>>
>>>>>>> 'feedback form.
>>>>>>>
>>>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>>>
>>>>>>>
>>>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>>>
>>>>>>> '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 SmtpMail class
>>>>>>>
>>>>>>> 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 Investigation
>>>>>>> Form</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=Check5
>>>>>>> runat="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:textbox id="occupation"
>>>>>>> runat=server width="200"/>
>>>>>>>
>>>>>>> </td>
>>>>>>>
>>>>>>> <td>
>>>>>>>
>>>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>>>
>>>>>>> <!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>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Juan T. Llibre

5/10/2007 7:53:00 PM

0

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"&quo... 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 to admin@yourserver.com.</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 his own.

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.n...
foros de asp.net, en español : http://asp.net...
===================================
"dancer" <dancer@microsoft.com> wrote in message news:u9DY37ykHHA.4768@TK2MSFTNGP05.phx.gbl...
> Also, David,
> I had asked why do I get this error message:
> Compiler Error Message: BC30452: Operator '&' is not defined for types String' and
> 'System.Web.UI.WebControls.TextBox'.
>
> A part of Juan's reply was Something else : you *must* put all the HTML content in ONE line.
>
> Do you have any thoughts on that error message?
>
>
> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
> news:ux4ML9xkHHA.1220@TK2MSFTNGP03.phx.gbl...
>> Ah,
>>
>> Sorry, I have my newsreader on to ignore read messages.
>>
>> The P tags break the lines in the rendered page. BR tags also break lines (work as a hard wrap).
>>
>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is allow the source html wrap
>> onto a new line, so that your line is not too long.
>>
>> 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 the backslash and n to create a
>> new line\n. I can't remember though, you might need \r\n to create a new line";
>>
>> backslash n.
>>
>> Is that what you looking for? This however doesn't affect your rendered output. 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.Ashfiel...
>> ~~
>> http://www.FOCUSP... - Local franchises available
>> "dancer" <dancer@microsoft.com> wrote in message news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
>>> David,
>>>
>>> Not exactly does this answer my question. Could you please check out Juan's answer to my first
>>> post on this subject and help me understand, since I was copying my code from this code.
>>>
>>> Thank you.
>>>
>>>
>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>>> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>>>> The vbCrLf are purely to ensure that the line is not too long when generated. There is a
>>>> problem with over long lines that when they do eventually 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 new paragraphs rather than breaking
>>>> paragraphs).
>>>>
>>>> Does this answer your question?
>>>>
>>>> (Note, you probably can't press "Yes" below as you probably can't see it. If you can, then you
>>>> have better eyes than me, as I can't see it. :-)
>>>>
>>>> --
>>>> Best regards,
>>>> Dave Colliver.
>>>> http://www.Ashfiel...
>>>> ~~
>>>> http://www.FOCUSP... - Local franchises available
>>>>
>>>> "dancer" <dancer@microsoft.com> wrote in message news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>>>> Hi Juan,
>>>>>
>>>>> What is the difference in what I am trying to do and this? Why can THEY 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 = "webmaster@asp101.com"
>>>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//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"&qu... 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 to webmaster@asp101.com.</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 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 />
>>>>>
>>>>> <p>
>>>>> Click <a href="http://www.asp101.com/samples/email_html_aspx.asp">here... to read about and
>>>>> download the source code.
>>>>> </p>
>>>>>
>>>>> </body>
>>>>> </html>
>>>>>
>>>>>
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>>>> You 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 use VbCrLf 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 HTML in a single line,
>>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as needed.
>>>>>>
>>>>>> 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.n...
>>>>>> foros de asp.net, en español : http://asp.net...
>>>>>> ===================================
>>>>>> "dancer" <dancer@microsoft.com> wrote in message news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>>>> Can somebody tell me why I get this message with the following code?
>>>>>>>
>>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for types '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 out the
>>>>>>>
>>>>>>> 'feedback form.
>>>>>>>
>>>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>>>
>>>>>>>
>>>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>>>
>>>>>>> '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 SmtpMail class
>>>>>>>
>>>>>>> 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 Investigation Form</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=Check5 runat="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:textbox id="occupation"
>>>>>>> runat=server width="200"/>
>>>>>>>
>>>>>>> </td>
>>>>>>>
>>>>>>> <td>
>>>>>>>
>>>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>>>
>>>>>>> <!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>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


dancer

5/10/2007 8:26:00 PM

0

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.



"Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
news:uqkVBzzkHHA.4312@TK2MSFTNGP02.phx.gbl...
> 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"&quo... 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 to
> admin@yourserver.com.</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 his
> own.
>
> 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.n...
> foros de asp.net, en español : http://asp.net...
> ===================================
> "dancer" <dancer@microsoft.com> wrote in message
> news:u9DY37ykHHA.4768@TK2MSFTNGP05.phx.gbl...
>> Also, David,
>> I had asked why do I get this error message:
>> Compiler Error Message: BC30452: Operator '&' is not defined for types
>> String' and 'System.Web.UI.WebControls.TextBox'.
>>
>> A part of Juan's reply was Something else : you *must* put all the HTML
>> content in ONE line.
>>
>> Do you have any thoughts on that error message?
>>
>>
>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>> news:ux4ML9xkHHA.1220@TK2MSFTNGP03.phx.gbl...
>>> Ah,
>>>
>>> Sorry, I have my newsreader on to ignore read messages.
>>>
>>> The P tags break the lines in the rendered page. BR tags also break
>>> lines (work as a hard wrap).
>>>
>>> vbCrLf is a Visual Basic Carriage Return Line Feed. All this does is
>>> allow the source html wrap onto a new line, so that your line is not too
>>> long.
>>>
>>> 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 the
>>> backslash and n to create a new line\n. I can't remember though, you
>>> might need \r\n to create a new line";
>>>
>>> backslash n.
>>>
>>> Is that what you looking for? This however doesn't affect your rendered
>>> output. 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.Ashfiel...
>>> ~~
>>> http://www.FOCUSP... - Local franchises available
>>> "dancer" <dancer@microsoft.com> wrote in message
>>> news:u3AxQ0xkHHA.1240@TK2MSFTNGP04.phx.gbl...
>>>> David,
>>>>
>>>> Not exactly does this answer my question. Could you please check out
>>>> Juan's answer to my first post on this subject and help me understand,
>>>> since I was copying my code from this code.
>>>>
>>>> Thank you.
>>>>
>>>>
>>>> "David" <david.colliver.NEWS@revilloc.REMOVETHIS.com> wrote in message
>>>> news:%23FGYIpxkHHA.3484@TK2MSFTNGP02.phx.gbl...
>>>>> The vbCrLf are purely to ensure that the line is not too long when
>>>>> generated. There is a problem with over long lines that when they do
>>>>> eventually 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
>>>>> new paragraphs rather than breaking paragraphs).
>>>>>
>>>>> Does this answer your question?
>>>>>
>>>>> (Note, you probably can't press "Yes" below as you probably can't see
>>>>> it. If you can, then you have better eyes than me, as I can't see it.
>>>>> :-)
>>>>>
>>>>> --
>>>>> Best regards,
>>>>> Dave Colliver.
>>>>> http://www.Ashfiel...
>>>>> ~~
>>>>> http://www.FOCUSP... - Local franchises available
>>>>>
>>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>>> news:uHX9FPxkHHA.4152@TK2MSFTNGP04.phx.gbl...
>>>>>> Hi Juan,
>>>>>>
>>>>>> What is the difference in what I am trying to do and this? Why can
>>>>>> THEY 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 = "webmaster@asp101.com"
>>>>>> 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 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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0
>>>>>> Transitional//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"&qu... 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 to
>>>>>> webmaster@asp101.com.</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 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 />
>>>>>>
>>>>>> <p>
>>>>>> Click <a
>>>>>> href="http://www.asp101.com/samples/email_html_aspx.asp">here... to
>>>>>> read about and download the source code.
>>>>>> </p>
>>>>>>
>>>>>> </body>
>>>>>> </html>
>>>>>>
>>>>>>
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
>>>>>> news:%231R59hwkHHA.1624@TK2MSFTNGP02.phx.gbl...
>>>>>>> You 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 use
>>>>>>> VbCrLf 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 HTML
>>>>>>> in a single line,
>>>>>>> line-breaking the body's content with "<br />" or "<P> ... </P>" as
>>>>>>> needed.
>>>>>>>
>>>>>>> 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.n...
>>>>>>> foros de asp.net, en español : http://asp.net...
>>>>>>> ===================================
>>>>>>> "dancer" <dancer@microsoft.com> wrote in message
>>>>>>> news:uUtpcLwkHHA.744@TK2MSFTNGP05.phx.gbl...
>>>>>>>> Can somebody tell me why I get this message with the following
>>>>>>>> code?
>>>>>>>>
>>>>>>>> Compiler Error Message: BC30452: Operator '&' is not defined for
>>>>>>>> types '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 out
>>>>>>>> the
>>>>>>>>
>>>>>>>> 'feedback form.
>>>>>>>>
>>>>>>>> objMM.To = "xxxxxxt@xxxxxxx.com"
>>>>>>>>
>>>>>>>>
>>>>>>>> objMM.From = "xxxxxxx@xxxxxxx.com"
>>>>>>>>
>>>>>>>> '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 SmtpMail
>>>>>>>> class
>>>>>>>>
>>>>>>>> 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 Investigation
>>>>>>>> Form</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=Check5
>>>>>>>> runat="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:textbox id="occupation"
>>>>>>>> runat=server width="200"/>
>>>>>>>>
>>>>>>>> </td>
>>>>>>>>
>>>>>>>> <td>
>>>>>>>>
>>>>>>>> <font face="Verdana" Size="2">How long has employee worked at 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"/>
>>>>>>>>
>>>>>>>> <!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>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


Mark Rae

5/10/2007 8:41:00 PM

0

"dancer" <dancer@microsoft.com> wrote in message
news:uV1Y2F0kHHA.568@TK2MSFTNGP02.phx.gbl...

> 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.

More and more people have their email software configured not to display the
HTML content of email.

Some people even have their email software configured to automatically
reject HTML email.

Don't use it if you can avoid it...


--
http://www.m...