CDONTS Question

  • Thread starter Thread starter Ed Richter
  • Start date Start date
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??
 
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??
 
-----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)
|/---------------------------------------------------
*----------------------------------------------------
 
Back
Top