newbie question

A

Auddog

I have a small problem, that I just can't solve. I'm passing information
from a form, defining my variables which are then emailed to me. I'm not
having problems send the email or anything like that. My problem is
hopefully simplier than that. I have the following line:

strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " "

which defines the variable with the text / variables. Currently this works
without problems. I just want to be able to add to this line a line break
and another variable. I've tried this layout:

strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " <br> " & strComments & "

This doesn't work it only as <br> into my email. Can someone offer another
why. Thanks for you help.

A

ps - here is the complete code:

<%
DIM strFirstName, strLastName, strSubject, strComments, strTextBody
strFirstName = request.form("fname")
strLastName = request.form("lname")
strSubject = "reported computer problem"
strComments = request.form("description")
strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " " %>

<%
'Case "CDOSYS"
'Use the CDOSYS component
sch = "http://schemas.microsoft.com/cdo/configuration/" 'new

Set cdoConfig = Server.CreateObject("CDO.Configuration") 'new

With cdoConfig.Fields 'new
..Item(sch & "sendusing") = 2 ' cdoSendUsingPort 'new
..Item(sch & "smtpserver") = "192.168.100.100" 'smtp server address here
..update 'new
End With 'new

Set objMail = Server.CreateObject("CDO.Message")

Set objMail.Configuration = cdoConfig 'new
objMail.From = "(e-mail address removed)"
objMail.To = "(e-mail address removed)"
objMail.Subject = strSubject
objMail.TextBody = strTextBody
objMail.Send

Set objMail = Nothing
Set cdoConfig = Nothing 'new
%>
 
M

McKirahan

Auddog said:
I have a small problem, that I just can't solve. I'm passing information
from a form, defining my variables which are then emailed to me. I'm not
having problems send the email or anything like that. My problem is
hopefully simplier than that. I have the following line:

strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " "

which defines the variable with the text / variables. Currently this works
without problems. I just want to be able to add to this line a line break
and another variable. I've tried this layout:

strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " <br> " & strComments & "

This doesn't work it only as <br> into my email. Can someone offer another
why. Thanks for you help.

A

ps - here is the complete code:

<%
DIM strFirstName, strLastName, strSubject, strComments, strTextBody
strFirstName = request.form("fname")
strLastName = request.form("lname")
strSubject = "reported computer problem"
strComments = request.form("description")
strTextBody = "this is a problem ticket from " & strFirstName & " "
&strLastName & " " %>

<%
'Case "CDOSYS"
'Use the CDOSYS component
sch = "http://schemas.microsoft.com/cdo/configuration/" 'new

Set cdoConfig = Server.CreateObject("CDO.Configuration") 'new

With cdoConfig.Fields 'new
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort 'new
.Item(sch & "smtpserver") = "192.168.100.100" 'smtp server address here
.update 'new
End With 'new

Set objMail = Server.CreateObject("CDO.Message")

Set objMail.Configuration = cdoConfig 'new
objMail.From = "(e-mail address removed)"
objMail.To = "(e-mail address removed)"
objMail.Subject = strSubject
objMail.TextBody = strTextBody
objMail.Send

Set objMail = Nothing
Set cdoConfig = Nothing 'new
%>

<br> is a line break in HTML.

Your e-mail is in plain text.

Change "<br>" to vbCrLf.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top