---
title: "Fel i mejl kod!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/52327-fel-i-mejl-kod"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Firegamez.com"
published: "2002-09-05T18:15:03.000Z"
updated: "2002-09-05T18:49:28.000Z"
replies: 3
views: 233
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/52327-fel-i-mejl-kod"
---

# Fel i mejl kod!

## #1 — Firegamez.com, 2002-09-05T18:15Z

Hej hej! Tack för all hjälp här! Kan ni också titta på denna kod! Jag får inget fel meddelande, det e bara att mejlen inte kommer fram! Jag har inte gjort detta script själv!

```
<%
'Replace the email address below with your email address
fromemail = "support@firegamez.com"

'Grab the submitted variables (page is the page they've come from, set by the hidden variable at the login box)
username = Request.Form("username")

'Check no s**t is trying to hack in using SQL commands
if InStr(username, "'") or InStr(username, """") or InStr(username, "=") then
	sqlflag = True
end if

'Open connection
%>
<!--#include file="conn.asp"-->
<%
'Get a recordset corresponding to the submitted username and password
sql = "SELECT password, email FROM users WHERE username = '" & username & "' AND active = True"
Set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.Open sql, conn, 3, 3

'If there was a valid recordset there, then send them back to the page they came from, with the username cookie set
If (not rsUser.BOF) and (not rsUser.EOF) and sqlflag <> True then
  On error resume next
  set objMail = Server.CreateObject("CDONTS.NewMail")
  
  if err.number <> 0 then 
	noObj = True
  else
	mailbody = "Tja " & username & vbcrlf & vbcrlf
	mailbody = mailbody  & "Ditt lösenord till Firegamez är:" & vbcrlf & vbcrlf
	mailbody = mailbody & "     " & rsUser("password") & vbcrlf & vbcrlf
	mailbody = mailbody & "----------------------------------------------------" & vbcrlf
	mailbody = mailbody & "Firegamez.com [url]http://www.firegamez.com[/url]"
	objMail.Body = mailbody
	objMail.to = rsUser("email")
	objMail.from = fromemail
	objMail.subject = "Glömt lösenordet"
	objMail.send
	set objMail = nothing 
	sentok = true
  end if
end if

'Otherwise, display an invalid entry screen
rsUser.close
set rsUser = nothing
conn.close
set conn = nothing%>
```

Permalänk: https://www.webforum.nu/p/52327

## #2 — Jesper T, 2002-09-05T18:27Z

Kan det bero på att du har On error resume next med, kommentera bort det.

Permalänk: https://www.webforum.nu/p/773051

## #3 — Firegamez.com, 2002-09-05T18:46Z

Jag tog bort de men då sa den Permisson Denied Line 42

Permalänk: https://www.webforum.nu/p/773062

## #4 — Jesper T, 2002-09-05T18:49Z

Kolla med hotellet, rättigheter å så.

Permalänk: https://www.webforum.nu/p/773065

---

Tråden på webben: https://www.webforum.nu/amne/asp/52327-fel-i-mejl-kod
