webForumDet fria alternativet

Anpassa för JMail?

ASP

0 svar · 150 visningar · startad av Korak

Medlem sedan maj 2001133 inlägg
Frågan#1

Hejsan, finns det någon vänlig själ som skulle kunna hjälpa mig att anpassa denna kod för JMail?
Jag får helt enkelt inte till det.

<%
'declare variables
Dim strTo, strSubject, strBody, strFrom 'Strings for recipient, subject, boby
Dim objCDOMail 'The CDO object
Dim objRec

'grab the variables from the form
  strFrom = Request.Form("From")
  strSubject = Request.Form("subject")
  strBody = Request.Form("body")

  Set objRec = Server.CreateObject ("ADODB.Recordset")

'open the database
  objRec.Open "EmailList", strConnect, adOpenKeyset, \_
      adLockReadOnly, adCmdTable

'notify the user that the broadcast has started
  Response.Write("\<h1\>Broadcast Starting\</h1\>")

'loop through the recordset
  While Not objRec.EOF
	'create a new cdo object
	  Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
	'set its properties
	  objCDOMail.From = strFrom
	  objCDOMail.To = objRec("EMail")
	  objCDOMail.Subject = strSubject
	  objCDOMail.Body = strBody
	'send the mail
	  objCDOMail.Send
	'set the object = nothing
	  Set objCDOMail = Nothing
	'confirm to the user that the mail has been sent
	  Response.Write "Message sent to " & objRec("EMail") & "!\<br\>" 
	'go to the next record
	  objRec.MoveNext
  WEND

'notify the user that the broadcast has completed
  Response.Write("\<h1\>Skickat !\</h1\>")

%>

Stort tack på förhand!

------------------

MVH, Korak
www.eskobar.nu

258 ms totalt · 4 externa anrop · v20260731065814-full.a51de22e
124 ms — deklarationer (db)
0 ms — hämta statistik (cache)
130 ms — hämta tråd, inlägg och bilagor (db)
125 ms — ändringar (db)