Hej!
Hjälper en kompis som har ett gammal formulärscript i asp. Problemet är att den bara hämtar ett av värdena i de ifyllda fälten.
Jag tror att problemet ligger i HTML.Body....där vill jag sätta flera värden eller ett samlingsvärde men den accepterar bara ett. Är ingen hejare på ASP.
<%
'KONTROLLERA OM ANROPET KOMMER FRÅN FORMULÄRET
if Request.Form("submit")="Skicka meddelande" then
'LÄS IN VARIABLERNA FRÅN FORMULÄRET
Namn=Request.Form("namn")
Epost=Request.Form("epost")
Arende=Request.Form("arende")
Meddelande=Request.Form("meddelande")
'VEM SKALL TA EMOT MEDDELANDET
mottagare="min e-postadress"
'DIMENSIONERA VARIABLERNA SOM BEHÖVS FÖR E-POSTRUTINEN
Dim iMsg
Dim iConf
Dim Flds
Dim sSubject
Dim sTextBody
Dim strSmartHost
Const cdoSendUsingPort = 2 'BETYDER ATT VI VILL SKICKA VIA SMTP PORT
'Variabeln StrSmartHost måsta ha värdet
'"websrv10" för att skriptet
'skall fungera!
StrSmartHost = "websrv10"
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = mottagare
.From = Epost
.Subject = Arende
.HTMLBody = Namn [CODE]/ Här ligger problemet, tror jag men...
.Send
End With
' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing %\>
<b>Tack för ditt meddelande nedan, vi kontaktar dig snarast!</b>
</body>
</html>
<%
else
%>
<b>Här kan du lämna ett meddelandet till oss!</b><p>
<form action="kontakt.asp" method="post">