Hi Guy's I am struggling to find where i am going wrong here, my signature adds to the HTML Table instead of after
in strHTML body I have closed off the table </tr> and in the email, i am trying to add signature after table but signature goes into table, i must have something wrong ?
I thought the bold </tr> would end the table
i thought the x 2 bold <br> and strSign would be outside of the table but goes into last row of table !!!!
Gotta have something wrong that i have mis understood ?
Would appreciate a nudge to what i can't understand ?
Code:
SigFile = "DMT dispatch@ Email Signature.jpg"
strSign = "Kindest Regards" & "<br>" & "<br>" & _ "<P><IMG border=0 hspace=0 alt='' src='file://T:/DMT Ltd/Logo Media/" & SigFile & "' align=baseline></P>" & "<br>" & "<br>" & _
"<FONT color=#00008B>" & eDisc & "<br>" & "<FONT color =#00008B>" & eDisc2
'SET THE TABLE AND HEADERS
strHTML = "<HTML><Body><table border='3' width=auto'><font color='blue' size='3' face='Times New Roman'><tr><th>Del To</th><th>Town</th><th>PostCode</th>" & _
"<th>Lift Type</th></th><th>MFG</th><th>SL</th><th>Qty</th><th>Arrived-Added</th><th>Date Due</th><th>Date Now</th><th>Days Remaining</font><th></tr>"
'LINK BODY WITH TABLE
strBody = strHTML
'SET RS CRITERIA
strType = "Item"
'SET THE RECORDS
strSQL = "SELECT tblStorage.ID, tblStorage.DelTo, tblStorage.Town, tblStorage.PostCode, tblStorage.MFG, tblStorage.SL, tblStorage.LiftType, tblStorage.Qty, tblStorage.DateAdded, tblStorage.DateDue " _
& "From tblStorage " _
& "ORDER BY tblStorage.DateDue;"
Set rs = CurrentDb.OpenRecordset(strSQL)
Do While Not rs.EOF
dtNow = Date
intDays = DateDiff("d", dtNow, rs.Fields("DateDue"))
Select Case intDays
Case Is > 7
strDays = "<font color='blue' size='4' face='Times New Roman'>" & DateDiff("d", dtNow, rs.Fields("DateDue")) & "</font>"
Case Else
strDays = "<font color='red' size='4' face='Times New Roman'><B>" & DateDiff("d", dtNow, rs.Fields("DateDue")) & "</font></B>"
End Select
strFS = "<font size='3' face='Times New Roman' style='text-align='center'>"
strFE = "</font>"
strBody = strBody & "<tr><td>" & strFS & rs.Fields("DelTo") & strFE & "</td><td>" & strFS & rs.Fields("Town") & strFE & "</td><td>" & strFS & rs.Fields("PostCode") & strFE & "</td><td>" & _
strFS & rs.Fields("LiftType") & strFE & "</td><td>" & strFS & rs.Fields("MFG") & strFE & "</td><td>" & strFS & rs.Fields("SL") & strFE & "</td><td>" & strFS & rs.Fields("Qty") & strFE & "</td><td>" & strFS & _
Format(rs.Fields("DateAdded"), "ddd-dd-mmm-yyyy") & strFE & "</td><td>" & strFS & Format(rs.Fields("DateDue"), "ddd-dd-mmm-yyyy") & strFE & "</td><td>" & _
strFS & Format(dtNow, "ddd-dd-mmm-yyyy") & "</td><td>" & strFE & strFS & strDays & strFE & "</td></tr>" & "|"
rs.MoveNext
Loop
strBody2 = strBody2
str7Day = "<font color='red' size='4' face='Times New Roman'>" & "Red" & "</font>"
strWarn = "Once The Days Remaining Field Is 7 Days Or Less, This Will Change To " & str7Day & _
" To Confirm There Is Only 7 Days Left For Delivery/Collection"
Set olItem = olApp.CreateItem(olMailItem)
Set olAccount = olApp.Session.Accounts.Item(1)
With olItem
.Attachments.Add aPath & aFile
.To = "me@home.com"
.subject = "DMT Live Updates" & "-" & Format(Me.txtUpdate, "ddd-dd-mmm-yyyy")
.HTMLBody = strFS & TOD & " Please find DMT Live Updates Attached" & "<br>" & "<br>" & _
"DMT Storage Data Listed: " & Format(Me.txtUpdate, "ddd-dd-mmm-yyyy") & "<br>" & "<br>" & _
strWarn & "<br>" & "<br>" & _
"Storage Data:" & "<br>" & Replace(strBody, "|", "<br>") & "<br>" & "<br>" & _
strSign
.ReadReceiptRequested = True
.SendUsingAccount = olAccount
.Display
End With