Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Format Text to display Bold

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2593
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Format Text to display Bold
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Format Text to display Bold - 4/6/2005 4:49:06 AM   
  kmattera

 

Posts: 4
Score: 0
Joined: 4/6/2005
From:
Status: offline
I have a form that collects information, then emails it to someone. Part of the code is as follows:

strBody = strBody & "Account No.: " & Request.Form("AccountNumber")

I can't figure out how I can make the actual information from the form show up in BOLD on the email. Is that possible?

Thanks!

K. Mattera
 
 
Post #: 1
 
 Re: Format Text to display Bold - 4/6/2005 12:24:19 PM   
  larryw24

 

Posts: 8
Score: 0
Joined: 4/1/2005
From: USA
Status: offline
You need to send a HTML-format message, instead of a plain-text message, in order to get BOLD.

You need to read up on the CDONTS.NewMail object. Use BodyFormat=1 to send plain text, and BodyFormat=0 to send HTML.

Here is sample code that creates an HTML-format message:

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")

HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "HTML = HTML & ""content=""text/html; charset=iso-8859-1"">"""
HTML = HTML & "<title>Sample NewMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "This is a sample message being sent using HTML. <BR></body>"
HTML = HTML & "</html>"

myMail.From = "Example@Microsoft.com"
myMail.To = "Someone@Company.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing

(in reply to kmattera)
 
 
Post #: 2
 
 Re: Format Text to display Bold - 4/7/2005 4:39:38 PM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Dear kmattera,
larryw24 is right, but if u wanna to use the same line of code, then do it this way:

strBody = strBody & "<B>Account No.: " & Request.Form("AccountNumber") & "</B>"

this way should work cause i tried it before...

Hope this helps,

Best Regards
Firas S Assaad

(in reply to kmattera)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Format Text to display Bold Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts