View Single Post
Join Date: Jan 2009
Posts: 12
Reputation: closetosane is an unknown quantity at this point 
Solved Threads: 1
closetosane closetosane is offline Offline
Newbie Poster

Re: Problems sending HTML email via vbscript

 
0
  #3
Jan 18th, 2009
Originally Posted by nrvinayak View Post
Please post the code. Then only it will be easier to debug and advise you.
Hello nrvinayak,

Thanks for the reply here is a snippit of the code:

  1. strReport = strReport & "<body>"
  2. strReport = strReport & "<div align='center'>"
  3. strReport = strReport & "<br>"
  4. strReport = strReport & "<table border='1' style='border-collapse: collapse'>"
  5. strReport = strReport & "<tr bgcolor='#DDDDDD' bordercolor='#DDDDDD'>"
  6. strReport = strReport & "<td width='408' colspan='3' ><H3>" & Employer_Name & " Requested Dispatch<H3></td>"
  7. strReport = strReport & "<td width='200' align= 'right'>" & FormatDateTime(Date(),1) & "</td>"
  8. strReport = strReport & "</tr>"
  9. strReport = strReport & "</table>"
  10. strReport = strReport & "<table border='1' style='border-collapse: collapse'>"
  11. strReport = strReport & "<tr bordercolor='#FFFFFF'>"
  12. strReport = strReport & "<td width='150'>Job Location :</td>"
  13. strReport = strReport & "<td width='150'>" & txtJobLocation &"</td>"
  14. strReport = strReport & "<td width='150'>Start Date :</td>"
  15. strReport = strReport & "<td width='150'>" & txtBegDate & "</td>"
  16. strReport = strReport & "</tr>"
  17. strReport = strReport & "<tr bordercolor='#FFFFFF'>"
  18. strReport = strReport & "<td width='150'>Report To :</td>"
  19. strReport = strReport & "<td width='150'>" & txtReport & "</td>"
  20. strReport = strReport & "<td width='150'>Start Time :</td>"
  21. strReport = strReport & "<td width='150'>" & txtTime & "</td>"
  22. strReport = strReport & "</tr>"
  23. strReport = strReport & "<tr bordercolor='#FFFFFF'>"
  24. strReport = strReport & "<td width='150'>Job Type :</td>"
  25. strReport = strReport & "<td width='150'>" & txtJob_Desc & "</td>"
  26. strReport = strReport & "<td width='150'>Living out :</td>"
  27. strReport = strReport & "<td width='150'>" & txtJobRegion & "</td>"
  28. strReport = strReport & "</tr>"
  29. strReport = strReport & "<tr bordercolor='#FFFFFF'>"
  30. strReport = strReport & "<td width='150'># of Members :</td>"
  31. strReport = strReport & "<td width='150'>" & intMembers & "</td>"
  32. strReport = strReport & "<td width='150'>Journey Persons :</td>"
  33. strReport = strReport & "<td width='150'>" & intJourneyPerson & "</td>"
  34. strReport = strReport & "</tr>"

The code is then placed as a string into the email

  1. Set objEmail = CreateObject("CDO.Message")
  2. objEmail.From = "Admin@canadian.ca"
  3. objEmail.To = "*****@shaw.ca"
  4. objEmail.Subject = "Requested Dispatch"
  5. objEmail.HTMLBody = strReport
  6. objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  7. objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="localhost"
  8. objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  9. objEmail.Configuration.Fields.Update
  10. objEmail.Send

The problem is that the entire string does not appear in the email. Removing a line from the string that does show up in the email will allow for aditional information that didn't show up in the email to now showup in the email. I dont see it as a line of code that is causing the problem but more of a string size issue. however, the string should not be so limited and in fact 'strReport' is also used to display the code on a webpage and the whole string shows up there.

Thanks in advance for any help.
Reply With Quote