Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS email body format changes depending on the content

Status
Not open for further replies.

jeffcullina

Programmer
May 13, 2002
80
US
I am creating an email using CDONTS. It works fine with the exception of the formatting of the body content. Depending on the values and/or data types in the variables called in the body, sometimes the lines will appear bold or italicized, and sometimes they show up as plain text. I am using no formatting so I should not be getting any bold or italicized text. How can I stop this? The code I am using is below.

<%
Dim objMail
Set objMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objMail.To = &quot;jeffrey.cullina@cdicorp.com&quot;
objMail.From = &quot;jeffrey.cullina@cdicorp.com
objMail.Subject = &quot;Test email&quot;
objMail.Body = &quot;First line&quot; & vbcrlf &_
&quot;COUNT: &quot; & icount & vbcrlf &_
&quot;TEXT&quot; & text
objMail.Send
set objMail = nothing
%>
 
It is currently in default (plain text) mode.

The problem might only be related to the Request.Form object rather than referncing a variable defined on the page. I have been trouble shooting for quite some time to figure out exactly where the problem lies, but I am not quite there yet. When a variavle is Null or Empty or is a number I seem to get problems. But it is not consistent.

Using this code, where the variable attempt was never actually created, the email had &quot;First Line&quot; bolded
objMail.Body = &quot;First line&quot; & vbcrlf &_
&quot;COUNT: &quot; & attempt & vbcrlf &_
&quot;TEXT: &quot; & text
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top