Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 5th, 2005, 02:26 AM
Richo1980 Richo1980 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 17 Richo1980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 26 m 55 sec
Reputation Power: 0
VBScript mailobject question

Hi,

I have a question regarding a CDONTS mailObject I have written in VBScript.
The code is below

dim strBody, bodyStr
dim fs, file
dim path

' Body of email

strBody = strBody & "<html>" & vbCrlf
strBody = strBody & "<body>" & vbCrlf
strBody = strBody & "<img src=http://www.test.com alt=Test Services width=580 height=65 align=middle>" & vbCrlf

strBody = strBody & "<p>" & vbCrlf
strBody = strBody & "<table width=580 border=1 align=middle cellpadding=6 cellspacing=0>" & vbCrlf

strBody = strBody & "<p>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Change Request ID:</b>:" & vbCrlf
strBody = strBody & "<td>" & Request.Form ("changerequest") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Brief Description:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("briefdescription") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Tested? Include brief description of how it was tested:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("yes") & vbCrlf
strBody = strBody & "<td>" & Request.Form("no") & vbCrlf
strBody = strBody & "<td>" & Request.Form("howtested") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Completed Time:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("comtime") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Completed Date:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("firstinput") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Change Summary:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("changesumm") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Documentation? Please provide referencing material:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("yes1") & vbCrlf
strBody = strBody & "<td>" & Request.Form("no1") & vbCrlf
strBody = strBody & "<td>" & Request.Form("documentation") & vbCrlf

strBody = strBody & "<tr>" & vbCrlf
strBody = strBody & "<td><b>Status:</b>" & vbCrlf
strBody = strBody & "<td>" & Request.Form("successful") & vbCrlf
strBody = strBody & "<td>" & Request.Form("failed") & vbCrlf
strBody = strBody & "<td>" & Request.Form("cancelled") & vbCrlf
strBody = strBody & "<td>" & Request.Form("other") & vbCrlf
strBody = strBody & "<td>" & Request.Form("newtext") & vbCrlf
strBody = strBody & "</tr>" & vbCrlf

strBody = strBody & "</body>" & vbCrlf
strBody = strBody & "</html>" & vbCrlf
for each strVar in Request.Form("option")
strBody = strBody & vbTab & strVar & vbNewLine
next

' Email me regarding Survey Results.

Set obCDOMail = Server.CreateObject("CDONTS.NewMail")
obCDOMail.BodyFormat = 0
obCDOMail.MailFormat = 0
obCDOMail.Importance = 1
'obCDOMail.To = "Email@test.com"
obCDOMail.From = """Tech"" <test@test.com>"
obCDOMail.Subject = "Change"
obCDOMail.Body = strBody
obCDOMail.Send
Set obCDOMail = Nothing

Everything is working as I expected it would, however if someone chooses more than one answer for a field with multiple responses the table expands accordingly. I realise this is because of the way I have set the tables up...I'm wondering if anyone can offer advice on how to correct this? Perhaps by using a different table structure?. The HTML output at the moment looks wrong as the table is being stretched across 3 rows...

Any advice would be greatly appreciated

Thanks

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VBScript mailobject question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT