---
title: "Anpassa för JMail?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/9310-anpassa-för-jmail"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Korak"
published: "2001-05-06T16:17:00.000Z"
updated: "2001-05-06T16:17:00.000Z"
replies: 0
views: 160
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/9310-anpassa-för-jmail"
---

# Anpassa för JMail?

## #1 — Korak, 2001-05-06T16:17Z

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!

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/9310-anpassa-för-jmail
