Nu har jeg ændret det! jeg har dog lavet brugernavn om til Brugerens ID:
Sql = "UPDATE quitusers SET Uemailstatus = 1 where UID = '" & quitusers.Fields.Item("UID") & "'"
Con.Execute Sql
Den gemmer dog ikke status! jeg smider lige hele kode - er den sat ind det forkerte sted???
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/quitsmoking.asp" -->
<%
Dim email
Dim email_numRows
Set email = Server.CreateObject("ADODB.Recordset")
email.ActiveConnection = MM_quitsmoking_STRING
email.Source = "SELECT * FROM emails WHERE Emailnr = 1"
email.CursorType = 0
email.CursorLocation = 2
email.LockType = 1
email.Open()
email_numRows = 0
%>
<%
Dim quitusers
Dim quitusers_numRows
Set quitusers = Server.CreateObject("ADODB.Recordset")
quitusers.ActiveConnection = MM_quitsmoking_STRING
quitusers.Source = "SELECT * FROM clients WHERE Ustartdate = Date()"
quitusers.CursorType = 0
quitusers.CursorLocation = 2
quitusers.LockType = 1
quitusers.Open()
quitusers_numRows = 0
%>
<%
server.scripttimeout = 3600
do until quitusers.eof
on error resume next
dim body
body = "<body background='
http://www.quitsmokingin30days.com/tellafriend/greybg.gif'>"body = body & "<div align='center'>"
body = body & "<center>"
body = body & "<table id='AutoNumber1' style='border-collapse: collapse' borderColor='#111111' cellSpacing='0' cellPadding='0' border='0'>"
body = body & "<tr>"
body = body & "<td><font face='Verdana' size='1'>"
body = body & "<img src='
http://www.quitsmokingin30days.com/tellafriend/topbar.gif' border='0' width='577' height='72'></font></td>"
body = body & "</tr>"
body = body & "<tr>"
body = body & "<td background='
http://www.quitsmokingin30days.com/tellafriend/greybg.gif'>"body = body & "<table id='AutoNumber2' style='border-collapse: collapse' borderColor='#111111' cellSpacing='0' cellPadding='0' width='577' border='0'>"
body = body & "<tr>"
body = body & "<td vAlign='bottom' bgColor='#ffffff'><font face='Verdana' size='1'> </font></td>"
body = body & "<td vAlign='bottom' width='129%' bgColor='#ffffff'>"
body = body & "<p align='center'><font face='Verdana' size='1'> </font></td>"
body = body & "<td vAlign='bottom' bgColor='#ffffff'><font face='Verdana' size='1'> </font></td>"
body = body & "</tr>"
body = body & "<tr>"
body = body & "<td bgColor='#ffffff'> </td>"
body = body & "<td width='129%' bgColor='#ffffff'><font face='Verdana' size='2'>Dear " & quitusers.Fields.Item("Ufirstname") & "<br>"
body = body & "<br>"
body = body & "This is your 1 mail from QuitSmokingIn30Days.com</font><p><font face='Verdana' size='2'>"
body = body & "<a href='
http://www.quitsmokingin30days.com/30emails/mail01.asp?Uemailadress=" & quitusers.Fields.Item("Uemailadress") & "'>You can view a better version of this mail here</a></font></p>"
body = body & "<p><font face='Verdana' size='2'>"
body = body & "----------------------------------------------------</font></p>"
body = body & "<p><font face='Verdana' size='2'>" & replace((email.Fields.Item("Emessage")),VbCrLf,"<br/>") & "</font></td>"
body = body & "<td bgColor='#ffffff'><font face='Verdana' size='1'> </font></td>"
body = body & "</tr>"
body = body & "<tr>"
body = body & "<td vAlign='top'><font face='Verdana' size='1'>"
body = body & "<img src='
http://www.quitsmokingin30days.com/tellafriend/gbox_bl.gif' border='0' width='15' height='15'></font></td>"
body = body & "<td vAlign='top' width='129%' bgColor='#ffffff'>"
body = body & "<p align='center'><font face='Verdana' size='1'> </font></td>"
body = body & "<td vAlign='top'><font face='Verdana' size='1'>"
body = body & "<img src='
http://www.quitsmokingin30days.com/tellafriend/gbox_br.gif' border='0' width='15' height='15'></font></td>"
body = body & "</tr>"
body = body & "</table>"
body = body & "</td>"
body = body & "</tr>"
body = body & "<tr>"
body = body & "<td background='
http://www.quitsmokingin30days.com/tellafriend/greybg.gif'>"body = body & "<font face='Verdana' size='1'> </font></td>"
body = body & "</tr>"
body = body & "</table>"
body = body & "</center>"
Set jmail = Server.CreateObject("JMail.Message")
jmail.Clear()
jmail.AddRecipient "anders@smz.dk"
jmail.From = "noreply@quitsmokingin30days.com"
jmail.FromName = "quitsmokingin30days.com"
'1 = High
'3 = Normal
'4 = Low
jmail.priority = 3
jmail.Subject = "quitsmokingin30days.com"
'Til dem der ikke har mulighed for at læse HTML mails, skriver vi lige en lille besked
jmail.Body = "Can´t read this mail? go to:
www.quitsmokingin30days.com" jmail.HTMLBody = body
jmail.Send "websmtp.quitsmokingin30days.com"
set JMail = nothing
Sql = "UPDATE quitusers SET Uemailstatus = 1 where UID = '" & quitusers.Fields.Item("UID") & "'"
Con.Execute Sql
quitusers.movenext
loop
%>
<%response.Redirect("mailsendt.asp")%>
<%
email.Close()
Set email = Nothing
%>
<%
quitusers.Close()
Set quitusers = Nothing
%>