SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Table in an email

    Hi friends

    i using jamil component to send emails to my clients using classic asp.

    I have table in my sql server which holds the data for apartulcar client in the

    following format

    entrydate, notes -(2 fields)

    i want to show this data in the jmail part of the code in tabular format...

    How can i achieve this.... below is the code i used to show the tabe in Classic asp page
    how can i show the same in the email format using Jmail.appendHTML

    <% set rs4=Server.CreateObject("ADODB.RecordSet")
    SQLCmd="select rtrim(ltrim(Rec_entry_date)) as entrydat,notes from clients where employeeid=" & EmpID & " order by entrydate asc"
    Dim strFont1,strfont2
    strFont1 = "<font style=""font-size:12px; color: #CC3333; font-family:verdana"">"
    strFont2 = "<font style=""font-size:10px; color: #000000; font-family:verdana"">"
    rs4.Open SQLCmd,strConnect3,adOpenStatic,adLockOptimistic,adCmdText


    If Not rs4.EOF Then
    Response.Write "<tr width =""133"" > <td width =""133"">"
    Response.Write strFont1 &("EntryDate") &"</td><td width =""133"">"
    Response.Write strFont1 &("Details") & "</td><td>"

    While Not rs4.EOF
    Response.Write "<tr width =""133""> <td width =""163"">"
    Response.Write strFont2 &rs4("entrydate") & "</td><td width =""133"">"
    Response.Write strFont2 &rs4("notes") & "</td><td>"


    Response.Write "</td></tr>"
    rs4.MoveNext
    Wend

    End If



    rs4.Close
    Set rs4 = Nothing





    %>

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Read the JMail docs and examples?

    http://www.dimac.net/Products/w3jmai.../HTMLemail.htm
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks siteguru but..i could not find anything that was useful ...can you help me out in any other way...

  4. #4
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    689
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you want to add a table to an email then you must build up the html as a long string of text assigned to a variable, similar to what you did with "strFont1", then add the variable to the email body.


    Code ASP:
     
    tabletext = [html string of code for table goes here]
     
     
     
    Set JMail = Server.CreateObject ("JMail.SMTPMail")
     
    JMail.Body = tabletext 
     
    JMail.Execute
    Set jMail = Nothing


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •