Forums

ASP

This topic is locked

Email CDONTS script

Posted 22 Oct 2003 07:00:09
1
has voted
22 Oct 2003 07:00:09 chadmih chad posted:
Howdy all. I am at my wits end with this. The script works fine but the "vbNewLine" does not seem to be creating the line breaks correctly. Only one shows up in the final email. Can anyone shed some light on this for me? Your help would be greatly appreciated.

Here is the full code:

<% @language="VBSCRIPT" %>
<%
Dim myMail, myBody, mySubject
myBody ="Where: "& request.form("intro" & vbNewLine & "Portfolio demonstration: "& request.form("question1" & vbNewLine & "Portfolio demonstration input: "& request.form("question1input"& vbNewLine & "Design process: "& request.form("question2"& vbNewLine & "Design process input: "& request.form("question2input"& vbNewLine & "Cust. Service rating: "& request.form("question3"& vbNewLine & "Cust. Service input: "& request.form("question3input" & vbNewLine & "Reliability rating: "& request.form("question4"& vbNewLine & "Deadlines rating: " & request.form("question5"& vbNewLine & "Print quality rating: "& request.form("question6" & vbNewLine & "Design quality rating: "& request.form("question7"& vbNewLine & "Design quality input: "& request.form("question7input" & vbNewLine & "Comments: "& request.form("message"& vbNewLine & "Criticism: "& request.form("crit"

mySubject =" "& request.form("subject"

Set myMail = Server.CreateObject ("CDONTS.NewMail"
myMail.From = request.form("email"
myMail.To = " "
myMail.Subject = mySubject
myMail.Body = myBody
myMail.Send
Response.Write("Thank you for your feedback. We appreciate you taking the time to help us make the world a better place."
set myMail=nothing
%>


<h6>JUXTAFLO_</h6>
<img src="www.juxtaflo.com/images/flashkit_footer.jpg" border=0>

Replies

Replied 25 Oct 2003 03:52:59
25 Oct 2003 03:52:59 Alberto Alexander replied:
try vbcrlf instead of vbNewLine, it works just fine in my environment
Replied 25 Oct 2003 04:07:42
25 Oct 2003 04:07:42 chadmih chad replied:
Thanks a lot for the reply. I didnt think anyone would answer.

I had actually tried that. It didnt seem to help at all. I will try it agaain and see how it goes.


Thanks.

<h6>JUXTAFLO_</h6>
<img src="www.juxtaflo.com/images/flashkit_footer.jpg" border=0>
Replied 25 Oct 2003 08:12:20
25 Oct 2003 08:12:20 Dan Berdusco replied:
Try using HTML code within your CDONTS Code. This will allow you to use a <pre id=code><font face=courier size=2 id=code>&lt;br&gt;</font id=code></pre id=code> for a line break. I have attached some sample code that works great for me...


<pre id=code><font face=courier size=2 id=code>
&lt;%
On Error Resume Next
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail"

HTML = "&lt;!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN""&gt;" & vbCrLf
HTML = HTML & "&lt;html&gt;"
HTML = HTML & "&lt;head&gt;"
HTML = HTML & "&lt;meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1""&gt;"
HTML = HTML & "&lt;title&gt;Any Title&lt;/title&gt;"
HTML = HTML & "&lt;/head&gt;"
HTML = HTML & "&lt;body&gt;"
HTML = HTML & "&lt;font face=""Verdana, Arial, Helvetica, sans-serif"" size=""-1""&gt;"
HTML = HTML & "&lt;b&gt;Name:&lt;/b&gt; " & request.form("txtName" & "&lt;br&gt;"
HTML = HTML & "&lt;b&gt;Company Name:&lt;/b&gt; " & request.form("txtCompany_Name" & "&lt;br&gt;"
HTML = HTML & "&lt;b&gt;Email Address:&lt;/b&gt; " & request.form("txtEmail" & "&lt;br&gt;"
HTML = HTML & "&lt;b&gt;Comments:&lt;/b&gt; " & request.form("Contact_Time" & "&lt;br&gt;&lt;font&gt;&lt;/body&gt;"
HTML = HTML & "&lt;/html&gt;"

myMail.From = request.form("txtEmail"
myMail.To = " "
myMail.Subject = "Your Subject Here"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing

%&gt;
</font id=code></pre id=code>

Reply to this topic