webForumDet fria alternativet

Function

3 svar · 215 visningar · startad av Ricki

RickiMedlem sedan juni 2000373 inlägg
#1

Varför fungerar inte detta?

<%
Function SendMail(Title,Mess)

Line4:	Option Explicit
	Dim objNewMail

	'---- BodyFormat Property ----
	Const CdoBodyFormatHTML	= 1	' The Body property is to include Hypertext Markup Language (HTML).
	Const CdoBodyFormatText	= 0	' The Body property is to be exclusively in plain text (default value).
	
	'---- MailFormat Property ----
	Const CdoMailFormatMime	= 0	' The NewMail object is to be in MIME format.
	Const CdoMailFormatText	= 1	' The NewMail object is to be in uninterrupted plain text (default value).

	'---- Importance Property ----
	Const CdoLow	= 0		' Low importance
	Const CdoNormal	= 1	' Normal importance (default)
	Const CdoHigh	= 2		' High importance

	'---- AttachFile and AttachURL Methods ----
	Const CdoEncodingUUencode	= 0	' The attachment is to be in UUEncode format (default).
	Const CdoEncodingBase64	= 1	' The attachment is to be in base 64 format.

	Set objNewMail = Server.CreateObject("CDONTS.NewMail")
		objNewMail.From = "webmaster@ricki.nu"
		objNewMail.To = "webmaster@ricki.nu"
		objNewMail.Subject = Title
		objNewMail.Body = Mess
		objNewMail.BodyFormat = CdoBodyFormatText
		objNewMail.MailFormat = CdoMailFormatText
		objNewMail.Importance = CdoNormal
		objNewMail.Send
	Set objNewMail = Nothing

End Function
%>

<%
		'----------------------------------------------------------------
		' Skicka ett mail
		'----------------------------------------------------------------
		Title	= "design &#0124; Registrering"
		Mess	= "Välkommen som medlem i design!"

		SendMail (Title,Mess)
%>

Jag får följande felmeddelande:

Programsats förväntas.
/design/inc-filer/sendMail.inc, line 4
Option Explicit

------------------
Hälsningar Ricki
www.ricki.nu

[Redigerat av Ricki den 10 dec 2000]

VideMedlem sedan dec. 19998 577 inlägg
#2

Option explicit måste ligga före allt annat...

Mvh, Vide

------------------
It's not that I'm afraid to die. I just don't want to be there when it happens.
Kom hem till mig...

RickiMedlem sedan juni 2000373 inlägg
#3

Före funktionen?
Vad gör Option explicit?

------------------
Hälsningar Ricki
www.ricki.nu

FreestylerMedlem sedan feb. 20002 218 inlägg
#4

Det ser väl till så att man måste deklarera variabler, eller?

------------------
what about I give you the finger...

138 ms totalt · 3 externa anrop · v20260731065814-full.91fd2ad2
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
134 ms — hämta tråd, inlägg och bilagor (db)