CDONTS Question

E

Ed Richter

Was wondering, when composing a message to be sent via CDONTS, is there away that I could embed a table into the message. The info I need to put in the message would best conveyed in tabular form, so wondering if there's a way to do this??
 
T

Thomas A. Rowe

You would have to send the email as HTML email, see:

http://www.siteexperts.com/tips/backend/ts08/page1.asp

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Was wondering, when composing a message to be sent via CDONTS, is there away
that I could embed a table into the message. The info I need to put in the
message would best conveyed in tabular form, so wondering if there's a way
to do this??
 
J

Jim Buyens

-----Original Message-----
Was wondering, when composing a message to be sent via
CDONTS, is there away that I could embed a table into the
message. The info I need to put in the message would
best conveyed in tabular form, so wondering if there's
a way to do this??

Sure, here's an example:

Dim objNewMail
Dim strBody
Set objNewMail = CreateObject("CDONTS.NewMail")

strBody = "<html>" & vbCrLf
strBody = strBody & "<head>" & vbCrLf
strBody = strBody & "<title>Msg w/ Table</title>" & vbCrLf
strBody = strBody & "</head>" & vbCrLf
strBody = strBody & "<body>" & vbCrLf
strBody = strBody & "<table>" & vbCrLf
strBody = strBody & "<tr>" & vbCrLf
strBody = strBody & "<td>Whatever you want</td>" & vbCrLf
strBody = strBody & "</tr>" & vbCrLf
strBody = strBody & "</table>" & vbCrLf
strBody = strBody & "</body>" & vbCrLf
strBody = strBody & "</html>" & vbCrLf

objNewMail.From = "(e-mail address removed)"
objNewMail.To = "(e-mail address removed)"
objNewMail.Subject = "Dinner Invitation"
objNewMail.BodyFormat = 0 ' means HTML
objNewMail.MailFormat = 0 ' means MIME
objNewMail.Body = strBody
objNewMail.Send
Set objNewMail = Nothing

You might, however, want to take a look at the CDO.Message
object, which relaces CDONTS.NewMail and is present on
Windows 2000 and newer systems. CDO.Message has several
improved features, one of which is the ability to specify
an outgoing mail server.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

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

Top