Nyhedsbrev - Sender forkerte informationer
Jeg har denne kode til mit nyhedsbrev:<%
if request("mode") = "send" then
'****** VÆLG PROGRAM TIL AT SENDE MAILEN ******
'1 = JMAIL
'2 = CDONTS
mailertype = 1
'**********************************************
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\varde.mdb") & ";UID=admin;"
SQL = "SELECT * from nyhedsbrev"
set send = conn.execute( SQL )
do while not send.eof
on error resume next
if mailertype = 1 then
Set JMail = Server.CreateObject("JMail.SMTPMail")
' This is my local SMTP server
JMail.ServerAddress = "smtp.vardehk.dk"
' mail config settings
JMail.Charset = "iso-8859-1"
JMail.ContentTransferEncoding = "8bit"
JMail.Sender = "no-reply@vardehk.dk"
JMail.Subject = "Varde HK's Nyhedsbrev - "&request("header")&""
JMail.AddRecipient send("email")
JMail.HTMLBody = ""&request("tekst")&" <br><br><font style='font-family:verdana; font-size:8px; color:#004277; margin:0px'>Frameld dig nyhedsbrevet ved at klikke <a href='http://www.vardehk.dk/nyhedsbrev.asp?mode=delete&email="&send("email")&"' style='font-family:verdana; font-size:9px; color:#004277; margin:0px' >HER</a></font></body>"
' 1 - highest priority (Urgent)
' 3 - normal
' 5 - lowest
JMail.Priority = 3
' Send it...
JMail.Execute
set JMail = nothing
elseif mailertype = 2 then
' importance = 0 ' lav
importance = 1 ' normal
' importance = 2 ' høj
Set mailObj = CreateObject("CDONTS.NewMail")
' send email med parametre : fra email, til email, header, besked, importance
mailObj.Send "afsenders emailadresse", send("email"), request("header"), request("tekst"), importance
' slet reference til CDONTS object
Set mailObj = Nothing
end if
response.redirect "sendt_nyhedsbrev.asp"
send.movenext
loop
conn.close
else
%>
<%
dato = date
%>
<form method="post" action="opret_nyhedsbrev.asp">
<INPUT TYPE="hidden" NAME="mode" VALUE="send">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="topoverskrift"> Opret Nyhedsbrev
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td valign="top">Overskrift
<input style="font-size:12px; border-style: solid; border-width: 1" NAME="header" rows="1"></input>
</td>
</tr>
<tr>
<td valign="top">Tekst<br>
<textarea id="elm1" NAME="tekst" rows="15" cols="80" style="font-size:12px; border-style: solid; border-width: 1; width:490px;" name="text" rows="30" cols="50">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<link rel="StyleSheet" href="http://vardehk.dk/style_nyhedsbrev.css" type="text/css">
</head>
<body>
<%dato=date%>
<img src="http://www.vardehk.dk/gfx/nyhedsbrev/top.png" ALT="Varde HK">
<table width="400px" style="font-family:verdana; font-size:10px; color:#004277; margin:0px">
<tr>
<td>
<h1 style="font-family:verdana; font-size:13px; color:#004277; margin:0px">Info fra bestyrelsen</h1>
</td>
<td align="right" valign="top" colspan="3">
Sendt d. <%=dato%>
</td>
</tr>
<tr>
<td colspan="3" width="400">
</td>
</tr>
<tr>
<td width="400px" valign="top" colspan="4">
<table width="100%" cellpadding="0" cellspacing="0" style="font-family:verdana; font-size:10px; color:#004277; margin:0px">
<tr>
<td class="topoverskrift" colspan="3">
<h1 style="font-family:verdana; font-size:13px; color:#004277; margin:0px">Aktivitetskalender</h1>
</td>
</tr>
<%
session.lcid=1030
i = 0
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "select * from aktiviteter WHERE dato>=date() order by dato asc"
rs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
do until i=5 or rs.eof
if a=1 then
bg="#B5B5B5"
a=0
else
bg="#FFFFFF"
a=1
end if
%>
<tr bgcolor="<%=bg%>">
<td width="30%">
<%=rs("dato")%>
</td>
<td width="5%">
:
</td>
<td width="65%">
<%=rs("tekst")%>
</td>
</tr>
<%
i = i + 1
rs.movenext
loop%>
</table>
</td>
</tr>
<tr>
<td height="5px">
</td>
</tr>
<tr>
<td width="400px" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" style="font-family:verdana; font-size:10px; color:#004277; margin:0px">
<tr>
<td class="topoverskrift">
<h1 style="font-family:verdana; font-size:13px; color:#004277; margin:0px">Holdnyheder</h1>
</td>
</tr>
<%
i = 0
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT Left([tekst],80) AS nyhed, overskrift, dato, id FROM holdnyhed order by dato desc"
rs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
do until i=5 or rs.eof
if d=1 then
bg="#B5B5B5"
d=0
else
bg="#FFFFFF"
d=1
end if
%>
<tr bgcolor="<%=bg%>">
<td width="35%">
<a style="font-family:verdana; font-size:10px; color:#004277; margin:0px" href="http://www.vardehk.dk/show_team_news.asp?id=<%=rs("id")%>">
<b><%=rs("overskrift")%> - <%=rs("dato")%></b>
</a>
</td>
</tr>
<%
i = i + 1
rs.movenext
loop%>
</table>
</td>
<td width="4px">
</td>
<td width="250px" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" style="font-family:verdana; font-size:10px; color:#004277; margin:0px">
<tr>
<td class="topoverskrift" colspan="3">
<h1 style="font-family:verdana; font-size:13px; color:#004277; margin:0px">Klubnyheder</h1>
</td>
</tr>
<%
i = 0
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT Left([tekst],80) AS nyhed, overskrift, dato, id FROM klubnyhed order by dato desc"
rs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
do until i=5 or rs.eof
if b=1 then
bg="B5B5B5"
b=0
else
bg="#FFFFFF"
b=1
end if
%>
<tr bgcolor="<%=bg%>">
<td width="35%">
<a style="font-family:verdana; font-size:10px; color:#004277; margin:0px" href="http://www.vardehk.dk/show_news.asp?id=<%=rs("id")%>">
<b><%=rs("overskrift")%> - <%=rs("dato")%></b>
</a>
</td>
</tr>
<%
i = i + 1
rs.movenext
loop%>
</table>
</td>
</tr>
</table>
</textarea>
</td>
</tr>
<tr>
<td>
<input style="border-style:solid; border-width:0px; background-color:#e3e3e3; font-size:12px" type="submit" value="Send Nyhedsbrev" name="B1">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
Det som så går galt, er at stien til billedet, som er http://www.vardehk.dk/gfx/nyhedsbrev/top.png, ikke bliver sendt afsted rigitg. Når jeg modtager mailen, er stien til billedet blevet til http://gfx/nyhedsbrev/top.png... Den har virket, men ligepludseligt vil den ikke sende den rigtig mere. Nogen der kan hjælpe mig...