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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making CDONTS prettier

Status
Not open for further replies.

SteveHigh

Technical User
Jan 17, 2007
158
0
0
GB
Hello

I use CDONTS on a Web site which works fine. The visitor inputs information via an online form and a copy is sent to the webmaster and the visitor himself:

<%
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.To = "Webmaster@hisSite.com"
ObjMail.CC = sEmailAddress
ObjMail.From = sEmailAddress
ObjMail.Subject = "Feedback"
ObjMail.Body = sFullNameTitle & vbcrlf&_
sFullName & vbcrlf&_
sEmailTitle & vbcrlf&_
sEmailAddress & vbcrlf&_
sBusinessTitle & vbcrlf&_
sBusinessName & vbcrlf&_
sCountryTitle & vbcrlf&_
sCountryName & vbcrlf&_
MessageName & vbcrlf&_
MessageTitle
ObjMail.Send
Set ObjMail = Nothing
%>

When the Webmaster/visitor receive their copies (by email, of course), it looks a bit boring, as in:

Name
John Smith
Email
JSmith@whatever.com
Business
Mechanics

etc

How would I make this message a little more attractive? For instance, to put Name, Email, etc in bold, or maybe use a different font from courier?

Many thanks

Steve
 
Hello Chris

Sorry for the delay in getting back to you.

Your suggestion seems hopeful; I'll try it tonight.

Very many thanks.

Steve
 
Hello

I have inserted

ObjMail.BodyFormat = 0
ObjMail.MailFormat = 0

as follows:

Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.BodyFormat = 0
ObjMail.MailFormat = 0
ObjMail.To = "Webmaster@hisSite.com"
ObjMail.CC = sEmailAddress
ObjMail.From = sEmailAddress
ObjMail.Subject = "Feedback"
ObjMail.Body = sFullNameTitle & vbcrlf&_
sFullName & vbcrlf&_
sEmailTitle & vbcrlf&_
sEmailAddress & vbcrlf&_
sBusinessTitle & vbcrlf&_
sBusinessName & vbcrlf&_
sCountryTitle & vbcrlf&_
sCountryName & vbcrlf&_
MessageName & vbcrlf&_
MessageTitle

and this produces (in my inbox) the following format:

Fullname Eample Email examples@yahoo.com Business None Country Example Message Hi

I now need to format the HTML, so that the email appears a little more attractive.

Do I do that in the code above? So if, for example, I wanted Fullname, Email, Business, Message to appear in navy verdana bold, in decsending order, how would I go about that?

Many thanks for any advice or an example.

Steve
 
SteveHigh, since you have amended the mail type to HTML you need to build your email using HTML i.e.:

Code:
ObjMail.Body = "<span style='font:bold 12px verdana; color:blue;'>Hello " &_
sFirstName & "!"

Cheers

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top