Får fejl når jeg vil sende ASPmail
Jeg får fejl når jeg sender mail fra min webside, men hva er fejlen?Her er min kode:
<%
DIM strName, strFirmName, strMessage, strTlf, strEmail, strModtager
strName =Request.Form("navn")
strFirmName =Request.Form("firmaNavn")
strMessage = Request.Form("besked")
strTlf = Request.Form("tlf")
strEmail = Request.Form("email")
strModtager = Request.Form("reciever")
ID = REQUEST.FORM("P_ID")
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail2.123hotel.dk"
JMail.Sender = strEmail
jmail.SenderName = strName
JMail.Subject = "Online kontakt"
JMail.AddRecipient strModtager
Jmail.ContentType = "text/html"
JMail.Priority = 2
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' ********** Her starter selve email-en
JMail.Body = "<html>"
JMail.Body = JMail.Body & "<head>"
JMail.Body = JMail.Body & "<title>Online kontakt</title>"
JMail.Body = JMail.Body & "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
JMail.Body = JMail.Body & "</head>"
JMail.Body = JMail.Body & "<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>"
JMail.Body = JMail.Body & "<tr>"
JMail.Body = JMail.Body & "<td valign='top' width='100%' style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size:10px; color=#77828D; padding:10px'><strong>Fra:</strong> "&Name&"<br><strong>Firma:</strong> "&strFirmName&"<br><strong>Email:</strong> "&strEmail&"<br><strong>Tlf:</strong> "&strTlf&"<br><br><strong>Besked:</strong><br>"&strMessage&"</td>"
JMail.Body = JMail.Body & "</tr>"
JMail.Body = JMail.Body & "</table>"
JMail.Body = JMail.Body & "</body>"
JMail.Body = JMail.Body & "</html>"
' ********** Her slutter selve email-en
On Error Resume Next
JMail.Execute
Set JMail = Nothing
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description'
response.redirect("kontakt.asp?P_ID="&ID&"&mail=error")
Else
response.redirect("kontakt.asp?P_ID="&ID&"&mail=done")
End If
%>
