Sending HTML CDONTS email. (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


WRXSTi -> Sending HTML CDONTS email. (3/4/2002 11:11:40)

Can some one please tell me why this HTML CDONTS code does not work. I placed it in the body of my .asp page.
Send a HTML CDONTS email.
 
<%
Option Explicit

Dim objNewMail
Dim strSubject
Dim strBody

strSubject = "Test this HTML mail"

strBody = "<body>" &_
"<br>" & _
"<h1>Hello</h1>" & _
"</body>"

Set objNewMail = Server.CreateObject("CDONTS.NewMail")

objNewMail.To = "jim.jenn@verizon.net"
objNewMail.From = "email@andersonj.net"
objNewMail.Subject = strSubject
objNewMail.Body = strBody

objNewMail.MailFormat = 0
objNewMail.BodyFormat = 0

objNewMail.Send

set objNewMail = nothing
%>


If I send a text message it works.
Text message here:
<% 
Dim objNewMail

Set objNewMail = Server.CreateObject("CDONTS.NewMail")

objNewMail.To = "jim.jenn@verizon.net"
objNewMail.From = "email@andersonj.net"

objNewMail.Subject = "This is a subject"
objNewMail.Body = "This is body"

objNewMail.Send

set obNewjMail = nothing

Response.write("Mail was Sent")
%>


Me




Spooky -> RE: Sending HTML CDONTS email. (3/4/2002 15:04:51)

Try this order :)

objNewMail.MailFormat = 0
objNewMail.BodyFormat = 0
objNewMail.Body = strBody



§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login




WRXSTi -> RE: Sending HTML CDONTS email. (3/4/2002 16:17:27)

The following also failed.
<% 
Option Explicit

Dim objNewMail
Dim strSubject
Dim strBody

strSubject = "Test this HTML mail"

strBody = "<body>" &_
"<br>" & _
"<h1>Hello</h1>" & _
"</body>"

Set objNewMail = Server.CreateObject("CDONTS.NewMail")

objNewMail.To = "jim.jenn@verizon.net"
objNewMail.From = "email@andersonj.net"
objNewMail.Subject = strSubject

objNewMail.MailFormat = 0
objNewMail.BodyFormat = 0
objNewMail.Body = strBody


objNewMail.Send

set objNewMail = nothing
%>


Me




neocortex -> RE: Sending HTML CDONTS email. (3/4/2002 18:16:19)

try this :

  
<%

objNewMail.MailFormat = cdoMailFormatMIME
objNewMail.BodyFormat = cdoBodyFormatHTML

%>


NC

Programming today, is a race between software engineers striving to build bigger and better 'idiot-proof' programs, and the Universe, trying to produce bigger and better idiots....So far, the Universe seems to be winning.




Spooky -> RE: Sending HTML CDONTS email. (3/5/2002 2:48:01)

There must be something wrong with either the component or the email client, the script works quite happily on my server.

The other constants can only be used when using the CDOVBS.inc file - but the values are the same as above anyhow.

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625