Link to home
Start Free TrialLog in
Avatar of westdh
westdhFlag for United States of America

asked on

why is my mail displaying in html format. I am sending mail to webmail using - strTextBody

why is my email displaying the html markup and not displaying the text when...I am using a
procform.asp  to send the text.

strTextBody  = "Wholesale Sales Order Form<hr><table width='740' border='0' cellspacing='0' cellpadding='3'><tr><td colspan='2' width ='390px'>Date: " & request.Form("orderDate") & "</td><td colspan='2' width ='390px'>Order No: " & request.Form("orderNumber") & "</td></tr><br><tr><td colspan='2' width ='390px'>Bill To: </td><td colspan='2' width ='390px'>Ship To: </td></tr><br><tr><td colspan='2' width ='390px'>Name: " & request.Form("billName") & "</td><td colspan='2' width ='390px'>Name: " & request.Form("shipName") & "</td></tr><br><tr><td colspan='2' width ='390px'>Address1: " & request.Form("billAddr1") & "</td><td colspan='2' width ='390px'>Address1: " & request.Form("shipAddr1") & "</td></tr><br><tr><td colspan='2' width ='390px'>Address2: " & request.Form("billAddr2") & "</td><td colspan='2' width ='390px'>Address2: " & request.Form("shipAddr2") & "</td></tr><br><tr><td colspan='2' width ='390px'>City: " & request.Form("billCity") & "</td><td colspan='2' width ='390px'>City: " & request.Form("shipCity") & "</td></tr>"
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

How are you sending your mail?  is it cdo or some other 3rd party?  You have to explicitly say you are sending html vs text.
When sending email you have to specify that the format is HTML otherwise it will be sent plain text.
What are you using to send email?
If it's CDOSYS then the format is this
MailObject.HTMLBody = ""
good examples here  http://www.paulsadowski.com/wsh/cdo.htm


Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "me@my.com"
objMessage.To = "test@paulsadowski.com"
'The line below shows how to send using HTML included directly in your script
objMessage.HTMLBody = "<h1>This is some sample message html.</h1>"

'The line below shows how to send a webpage from a remote site
'objMessage.CreateMHTMLBody "http://www.paulsadowski.com/wsh/"

'The line below shows how to send a webpage from a file on your machine
'objMessage.CreateMHTMLBody "file://c|/temp/test.htm"

objMessage.Bcc = "you@your.com"
objMessage.Cc = "you2@your.com"
objMessage.Send
Avatar of westdh

ASKER

This is what I am using: and asp form
------------
<%
Const cdoBasic = 1 'Use basic (clear-text) authentication.
Const cdoSendUsingPort = 2
'cdosys related
Dim iMsg
Dim iConf
Dim Flds
'mail related
Dim strMsg
Dim strTo
Dim strCC
Dim strFrom
Dim strSubject
Dim strTextBody

'==================begin your configuration=============================
'you must have a username and pass word or you will not be able to send
'
Dim sendusername      : sendusername      = "info@dianewestdesign.com"
'Dim sendusername      : sendusername      = "westdh@charter.net"
Dim userpassword      : userpassword      = "Inquiry321"
Dim smtpserver       : smtpserver      = "mail-08.name-services.com"

if (len(TRIM(request.Form("sname"))) <> 0) and (len(TRIM(request.Form("email"))) <> 0) Then            

'===================begin set your info here============================
'set your TO, CC, From, Subject and body here
'
strTo       = "info@dianewestdesign.com"
'strTo       = "westdh@charter.net"
strCC       = ""
strFrom       = request.Form("email")

strSubject       = "Wholesale Sales Order Form"

strTextBody       = "Wholesale Sales Order Form<hr><table width='740' border='0' cellspacing='0' cellpadding='3'><tr><td colspan='2' width ='390px'>Date: " & request.Form("orderDate") & "</td><td colspan='2' width ='390px'>Order No: " & request.Form("orderNumber") & "</td></tr><br><tr><td colspan='2' width ='390px'>Bill To: </td><td colspan='2' width ='390px'>Ship To: </td></tr><br><tr><td colspan='2' width ='390px'>Name: " & request.Form("billName") & "</td><td colspan='2' width ='390px'>Name: " & request.Form("shipName") & "</td></tr><br><tr><td colspan='2' width ='390px'>Address1: " & request.Form("billAddr1") & "</td><td colspan='2' width ='390px'>Address1: " & request.Form("shipAddr1") & "</td></tr><br><tr><td colspan='2' width ='390px'>Address2: " & request.Form("billAddr2") & "</td><td colspan='2' width ='390px'>Address2: " & request.Form("shipAddr2") & "</td></tr><br><tr><td colspan='2' width ='390px'>City: " & request.Form("billCity") & "</td><td colspan='2' width ='390px'>City: " & request.Form("shipCity") & "</td></tr><br><tr><td width ='100px'>State: " & request.Form("billState") & "</td><td>Zip: " & request.Form("billZip") & "</td><td width ='100px'>State: " & request.Form("shipState") & "</td><td colspan='2'>Zip: " & request.Form("shipZip") & "</td></tr><hr><tr><td width ='120px'>P.O. NO:</td><td>Terms:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rep:</td><td width ='50px'>SHIP: </td><td>Contract NO:</td></tr><br><tr><td>" & request.Form("poNum") & "</td><td>" & request.Form("Terms") & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & request.Form("Rep") & "<td width ='50px'>" & request.Form("ship") & "</td><td>" & request.Form("contactNum") & "</td></tr></table><hr><table width='740' border='0' cellspacing='0' cellpadding='3'><tr><td align='center'>Item<br>Number</td><td> Description </td><td colspan='5' align='center'>-------------------------- Quantity ------------------------</td><td>&nbsp;&nbsp;&nbsp; Quantity of<br>non-sized items</td></tr><br><tr><td width='40'>&nbsp;</td><td width='60'>&nbsp;</td><td width='40' align='right'>XSM</td><td width='50' align='right'>SM</td><td width='50' align='right'> MED </td><td width='50' align='right'>LG</td><td width='50' align='right'>Xl</td></tr><br><tr><td>0001</td><td>BLK/RED</td><td width='60' align='right'>" & request.form("0001-xsm") & "</td><td width='60' align='right'>" & request.form("0001-sm") & "</td><td width='60' align='right'>" & request.form("0001-med") & "</td><td width='60' align='right'>" & request.form("0001-lg") & "</td><td width='60' align='right'>" & request.form("0001-xl") & "</td></tr><tr><td>0002</td><td>BLK/BLK</td><td width='60' align='right'>" & request.form("0002-xsm") & "</td><td width='60' align='right'>" & request.form("0002-sm") & "</td><td width='60' align='right'>" & request.form("0002-med") & "</td><td width='60' align='right'>" & request.form("0002-lg") & "</td><td width='60' align='right'>" & request.form("0002-xl") & "</td></tr><tr><td>0003</td><td>BLK/WHT</td><td width='60' align='right'>" & request.form("0003-xsm") & "</td><td width='60' align='right'>" & request.form("0003-sm") & "</td><td width='60' align='right'>" & request.form("0003-med") & "</td><td width='60' align='right'>" & request.form("0003-lg") & "</td><td width='60' align='right'>" & request.form("0003-xl") & "</td></tr><tr><td>0004</td><td>BLK/Yel</td><td width='60' align='right'>" & request.form("0004-xsm") & "</td><td width='60' align='right'>" & request.form("0004-sm") & "</td><td width='60' align='right'>" & request.form("0004-med") & "</td><td width='60' align='right'>" & request.form("0004-lg") & "</td><td width='60' align='right'>" & request.form("0004-xl") & "</td></tr><tr><td>0005</td><td>BLK/Org</td><td width='60' align='right'>" & request.form("0005-xsm") & "</td><td width='60' align='right'>" & request.form("0005-sm") & "</td><td width='60' align='right'>" & request.form("0005-med") & "</td><td width='60' align='right'>" & request.form("0005-lg") & "</td><td width='60' align='right'>" & request.form("0005-xl") & "</td></tr><tr><td>0006</td><td>BLK/PNK</td><td width='60' align='right'>" & request.form("0006-xsm") & "</td><td width='60' align='right'>" & request.form("0006-sm") & "</td><td width='60' align='right'>" & request.form("0006-med") & "</td><td width='60' align='right'>" & request.form("0006-lg") & "</td><td width='60' align='right'>" & request.form("0006-xl") & "</td></tr><tr><td>0007</td><td>BLK/BLU</td><td width='60' align='right'>" & request.form("0007-xsm") & "</td><td width='60' align='right'>" & request.form("0007-sm") & "</td><td width='60' align='right'>" & request.form("0007-med") & "</td><td width='60' align='right'>" & request.form("0007-lg") & "</td><td width='60' align='right'>" & request.form("0007-xl") & "</td></tr><tr><td>0008</td><td>BLK/GRN-Neon</td><td width='60' align='right'>" & request.form("0008-xsm") & "</td><td width='60' align='right'>" & request.form("0008-sm") & "</td><td width='60' align='right'>" & request.form("0008-med") & "</td><td width='60' align='right'>" & request.form("0008-lg") & "</td><td width='60' align='right'>" & request.form("0008-xl") & "</td></tr><tr><td>0009</td><td>BLK/Purp</td><td width='60' align='right'>" & request.form("0009-xsm") & "</td><td width='60' align='right'>" & request.form("0009-sm") & "</td><td width='60' align='right'>" & request.form("0009-med") & "</td><td width='60' align='right'>" & request.form("0009-lg") & "</td><td width='60' align='right'>" & request.form("0009-xl") & "</td></tr><tr><td>0010</td><td>CLR/WHT</td><td width='60' align='right'>" & request.form("0010-xsm") & "</td><td width='60' align='right'>" & request.form("0010-sm") & "</td><td width='60' align='right'>" & request.form("0010-med") & "</td><td width='60' align='right'>" & request.form("0010-lg") & "</td><td width='60' align='right'>" & request.form("0010-xl") & "</td></tr><tr><td>0011</td><td>CLR/PNK</td><td width='60' align='right'>" & request.form("0011-xsm") & "</td><td width='60' align='right'>" & request.form("0011-sm") & "</td><td width='60' align='right'>" & request.form("0011-med") & "</td><td width='60' align='right'>" & request.form("0011-lg") & "</td><td width='60' align='right'>" & request.form("0011-xl") & "</td></tr><tr><td>0012</td><td>CLR/BLK</td><td width='60' align='right'>" & request.form("0012-xsm") & "</td><td width='60' align='right'>" & request.form("0012-sm") & "</td><td width='60' align='right'>" & request.form("0012-med") & "</td><td width='60' align='right'>" & request.form("0012-lg") & "</td><td width='60' align='right'>" & request.form("0012-xl") & "</td></tr><tr><td>0013</td><td>WHT/WHT</td><td width='60' align='right'>" & request.form("0013-xsm") & "</td><td width='60' align='right'>" & request.form("0013-sm") & "</td><td width='60' align='right'>" & request.form("0013-med") & "</td><td width='60' align='right'>" & request.form("0013-lg") & "</td><td width='60' align='right'>" & request.form("0013-xl") & "</td></tr><tr><td>0014</td><td>WHT/RED</td><td width='60' align='right'>" & request.form("0014-xsm") & "</td><td width='60' align='right'>" & request.form("0014-sm") & "</td><td width='60' align='right'>" & request.form("0014-med") & "</td><td width='60' align='right'>" & request.form("0014-lg") & "</td><td width='60' align='right'>" & request.form("0014-xl") & "</td></tr><tr><td>0015</td><td>WHT/PINK</td><td width='60' align='right'>" & request.form("0015-xsm") & "</td><td width='60' align='right'>" & request.form("0015-sm") & "</td><td width='60' align='right'>" & request.form("0015-med") & "</td><td width='60' align='right'>" & request.form("0015-lg") & "</td><td width='60' align='right'>" & request.form("0015-xl") & "</td></tr><tr><td>0016</td><td>WHT/BLK</td><td width='60' align='right'>" & request.form("0016-xsm") & "</td><td width='60' align='right'>" & request.form("0016-sm") & "</td><td width='60' align='right'>" & request.form("0016-med") & "</td><td width='60' align='right'>" & request.form("0016-lg") & "</td><td width='60' align='right'>" & request.form("0016-xl") & "</td></tr><tr><td>0017</td><td>RED/WHT</td><td width='60' align='right'>" & request.form("0016-xsm") & "</td><td width='60' align='right'>" & request.form("0017-sm") & "</td><td width='60' align='right'>" & request.form("0017-med") & "</td><td width='60' align='right'>" & request.form("0017-lg") & "</td><td width='60' align='right'>" & request.form("0017-xl") & "</td></tr><tr><td>0018</td><td>RED/BLK</td><td width='60' align='right'>" & request.form("0018-xsm") & "</td><td width='60' align='right'>" & request.form("0018-sm") & "</td><td width='60' align='right'>" & request.form("0018-med") & "</td><td width='60' align='right'>" & request.form("0018-lg") & "</td><td width='60' align='right'>" & request.form("0018-xl") & "</td></tr><tr><td>0019</td><td>YEL/BLK</td><td width='60' align='right'>" & request.form("0019-xsm") & "</td><td width='60' align='right'>" & request.form("0019-sm") & "</td><td width='60' align='right'>" & request.form("0019-med") & "</td><td width='60' align='right'>" & request.form("0019-lg") & "</td><td width='60' align='right'>" & request.form("0019-xl") & "</td></tr><tr><td>0020</td><td>GRN/YEL</td><td width='60' align='right'>" & request.form("0020-xsm") & "</td><td width='60' align='right'>" & request.form("0020-sm") & "</td><td width='60' align='right'>" & request.form("0020-med") & "</td><td width='60' align='right'>" & request.form("0020-lg") & "</td><td width='60' align='right'>" & request.form("0020-xl") & "</td></tr><tr><td>0021</td><td>ORG/BLK</td><td width='60' align='right'>" & request.form("0021-xsm") & "</td><td width='60' align='right'>" & request.form("0021-sm") & "</td><td width='60' align='right'>" & request.form("0021-med") & "</td><td width='60' align='right'>" & request.form("0021-lg") & "</td><td width='60' align='right'>" & request.form("0021-xl") & "</td></tr><tr><td>0022</td><td>BLU/ORG</td><td width='60' align='right'>" & request.form("0022-xsm") & "</td><td width='60' align='right'>" & request.form("0022-sm") & "</td><td width='60' align='right'>" & request.form("0022-med") & "</td><td width='60' align='right'>" & request.form("0022-lg") & "</td><td width='60' align='right'>" & request.form("0022-xl") & "</td></tr><tr><td>0023</td><td>DK BLU/YEL</td><td width='60' align='right'>" & request.form("0023-xsm") & "</td><td width='60' align='right'>" & request.form("0023-sm") & "</td><td width='60' align='right'>" & request.form("0023-med") & "</td><td width='60' align='right'>" & request.form("0023-lg") & "</td><td width='60' align='right'>" & request.form("0023-xl") & "</td></tr><tr><td>0024</td><td>SKY BLU/WHT</td><td width='60' align='right'>" & request.form("0024-xsm") & "</td><td width='60' align='right'>" & request.form("0024-sm") & "</td><td width='60' align='right'>" & request.form("0024-med") & "</td><td width='60' align='right'>" & request.form("0024-lg") & "</td><td width='60' align='right'>" & request.form("0024-xl") & "</td></tr><tr><td>0025</td><td>ROY BLU/WHT</td><td width='60' align='right'>" & request.form("0025-xsm") & "</td><td width='60' align='right'>" & request.form("0025-sm") & "</td><td width='60' align='right'>" & request.form("0025-med") & "</td><td width='60' align='right'>" & request.form("0025-lg") & "</td><td width='60' align='right'>" & request.form("0025-xl") & "</td></tr><tr><td>0026</td><td>PNK/PURP</td><td width='60' align='right'>" & request.form("0026-xsm") & "</td><td width='60' align='right'>" & request.form("0026-sm") & "</td><td width='60' align='right'>" & request.form("0026-med") & "</td><td width='60' align='right'>" & request.form("0026-lg") & "</td><td width='60' align='right'>" & request.form("0026-xl") & "</td></tr><tr><td>0027</td><td>PNK/WHT</td><td width='60' align='right'>" & request.form("0027-xsm") & "</td><td width='60' align='right'>" & request.form("0027-sm") & "</td><td width='60' align='right'>" & request.form("0027-med") & "</td><td width='60' align='right'>" & request.form("0027-lg") & "</td><td width='60' align='right'>" & request.form("0027-xl") & "</td></tr><tr><td>0028</td><td>PUR?WHT</td><td width='60' align='right'>" & request.form("0028-xsm") & "</td><td width='60' align='right'>" & request.form("0028-sm") & "</td><td width='60' align='right'>" & request.form("0028-med") & "</td><td width='60' align='right'>" & request.form("0028-lg") & "</td><td width='60' align='right'>" & request.form("0028-xl") & "</td></tr><tr><td>0029</td><td>PUR/YEL</td><td width='60' align='right'>" & request.form("0029-xsm") & "</td><td width='60' align='right'>" & request.form("0029-sm") & "</td><td width='60' align='right'>" & request.form("0029-med") & "</td><td width='60' align='right'>" & request.form("0029-lg") & "</td><td width='60' align='right'>" & request.form("0029-xl") & "</td></tr><tr><td>0030</td><td>LAV/BLU GLOW</td><td width='60' align='right'>" & request.form("0030-xsm") & "</td><td width='60' align='right'>" & request.form("0030-sm") & "</td><td width='60' align='right'>" & request.form("0030-med") & "</td><td width='60' align='right'>" & request.form("0030-lg") & "</td><td width='60' align='right'>" & request.form("0030-xl") & "</td></tr><tr><td>0031</td><td>CLR/BTU GLOW</td><td width='60' align='right'>" & request.form("0031-xsm") & "</td><td width='60' align='right'>" & request.form("0031-sm") & "</td><td width='60' align='right'>" & request.form("0031-med") & "</td><td width='60' align='right'>" & request.form("0031-lg") & "</td><td width='60' align='right'>" & request.form("0031-xl") & "</td></tr><tr><td>0032</td><td>RASTA</td><td width='60' align='right'>" & request.form("0032-xsm") & "</td><td width='60' align='right'>" & request.form("0032-sm") & "</td><td width='60' align='right'>" & request.form("0032-med") & "</td><td width='60' align='right'>" & request.form("0032-lg") & "</td><td width='60' align='right'>" & request.form("0032-xl") & "</td></tr><tr><td>0033</td><td>CARIB 3 COL,2 BLU, 1GRN</td><td width='60' align='right'>" & request.form("0033-xsm") & "</td><td width='60' align='right'>" & request.form("0033-sm") & "</td><td width='60' align='right'>" & request.form("0033-med") & "</td><td width='60' align='right'>" & request.form("0033-lg") & "</td><td width='60' align='right'>" & request.form("0033-xl") & "</td></tr><tr><td>0036</td><td>Jungle Camo/YEL</td><td width='60' align='right'>" & request.form("0036-xsm") & "</td><td width='60' align='right'>" & request.form("0036-sm") & "</td><td width='60' align='right'>" & request.form("0036-med") & "</td><td width='60' align='right'>" & request.form("0036-lg") & "</td><td width='60' align='right'>" & request.form("0036-xl") & "</td></tr></table><hr><table width='740' border='0' cellspacing='0' cellpadding='3'><tr><td width='150'>&nbsp;</td><td width='420'><b>Quantity of non-sized items</b></td><td width='60'>&nbsp;</td></tr><hr><tr><td>0066</td><td>6 HOLOGRA MS</td><td align'right'>" & request.form("0066") & "</td><tr><td>0088</td><td>8 HOLOGRA MS</td><td align'right'>" & request.form("0088") & "</td><tr><td>ASSORT/ED</td><td>ASSORTED BANDS, RANDOM SIZES & COLORS</td><td align'right'>" & request.form("assort") & "</td><tr><td>0075</td><td>75 Wristbands W/DISPLAY</td><td align'right'>" & request.form("0075") & "</td><tr><td>0100</td><td>FREQUENCY - INFUSED ANIMAL TAG</td><td align'right'>" & request.form("0100") & "</td><tr><td>DISPLAY</td><td>WIRE DISPLAY</td><td align'right'>" & request.form("display") & "</td></tr></table><hr>"

'============================================================================================================================================================
'Create message and configuration objects
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
'Apply settings to the configuration object
With Flds
' Specify the authentication mechanism to basic (clear-text) authentication.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
' The username for authenticating to an SMTP server
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = sendusername
' The password used to authenticate to an SMTP server
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = userpassword
' Port
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Specify mail server
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
'Specify the timeout in seconds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
' The port on which the SMTP service specified by the smtpserver field is listening for connections (typically 25)
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
'.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
.Update
End With

'Apply the settings to the message object and send it
With iMsg
Set .Configuration = iConf
.To = strTo
.From = strFrom
If strCC <> "" Then
.CC = strCC
End If
.Subject = strSubject
.TextBody = strTextBody      
'Send message
.Send
End With
' cleanup mail objects
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

Msg = "Your message has been sent. Thank you!"

Else
Msg = "All required fields were not completed. Please go back and fill in missing information."
End If
%>
<!-- END CODE SECTION -->
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of westdh

ASKER

That one did it for me thanks