|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VBScript mailobject question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|