CDO Message - I want to send more than one line in my email message.

I have tried several different ways to send more than just the details of my message.  Below is what I want to do but isn't working.  If I replace all the .TextBody lines with just  .TextBody = Request1.Details.Text  the code works fine.  But the minute I try to get more complicated my .ASP page won't display because there is an error.  How do I get the multiple lines of the TextBody to be displayed in my email?

Set cdoMessage = Server.CreateObject("CDO.Message")
    On Error Resume Next
    With cdoMessage
        Set .Configuration = cdoConfig
        .Fields("urn:schemas:httpmail:importance").Value = 2
        .From = Requests1.EmailAddr.Text
        .To = "terrys@xxxxxx.com"
        .Subject = "New IT Request"
        .TextBody = "Date/Time: " & Request1.ReqDate.Text & Chr(10) & Chr(13)
        .TextBody = .TextBody & "Requestor: " & Request1.Requestor.Text
        .TextBody = .TextBody & "     Phone: " & Request1.Phone.Text & Chr(10) & Chr(13) & chr(10) & chr(13)
        .TextBody = .TextBody & "Priority: " ReqPriority
        .TextBody = .TextBody & "     Request Type: " & Request1.ReqType.Text
        .TextBody = .TextBody & "     Category: " & Request1.Category.Text & Chr(10) & Chr(13) & chr(10) & chr(13)
        .TextBody = .TextBody & Request1.Details.Text

        .Send
    End With
    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    On Error Goto 0
terrydschmidtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

g_johnsonCommented:
what is the error?

try building textBody in a string

strText = this & chr(10) & chr(13) & that etc ...

.textbody = strText
0
terrydschmidtAuthor Commented:
I just tried this   .TextBody = "Test:" & Request1.Details.Text    and I get a blank message but NO error.  
This is in an .asp file on my webpage.
So, I tried .TextBody = "Test:"  and that works.  Test: shows in my email message.

I tried:
Dim txtBody

txtBody = "Test"

.txtBody = txtBody

I got Test in my email message but if I did:  .txtBody = txtBody & Request1.Details.Text  I got a blank message.  It seems like an & is not working.  My visual basic is rusty how do I create a string without ampersans?
0
terrydschmidtAuthor Commented:
OK, ampersan is not the problem it's when I combine quoted text and a variable.

txtBody = "Hi there" & vbNewLine & vbNewLine & _
        "This is line 1" & vbNewLine & _
        "This is line 2" & vbNewLine & _
        "This is line 3" & vbNewLine & _
        "This is line 4"

above works - my email message shows all the text.

txtBody = "Hi there" & vbNewLine & vbNewLine & _
        "This is line 1" & vbNewLine & _
        "This is line 2" & vbNewLine & _
        "This is line 3" & vbNewLine & _
        "This is line 4" & Request1.Details.Text

above does not work.  I get a blank email message.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

g_johnsonCommented:
you're in uncharted territory for me, but what about something like

strHold = request1.details.text

txtbody = ... & vbNewLine & "This is line 4" & strHold

0
terrydschmidtAuthor Commented:
I think I found my error. Request1.Details.Text is suppose to be Requests1.Details.Text  (see the s between the t and the 1 it helps when it there).  I now broke my send so I am not getting any emails to test.  I get back to you when I figure what I broke.

0
terrydschmidtAuthor Commented:
I answered my own question above.  Thanks!
0
GranModCommented:
PAQed with points refunded (125)

GranMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.