---
title: "CDONTS till CDOSYS"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/159691-cdonts-till-cdosys"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "ipanema"
published: "2007-04-27T08:05:21.000Z"
updated: "2007-04-27T09:51:45.000Z"
replies: 3
views: 866
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/159691-cdonts-till-cdosys"
---

# CDONTS till CDOSYS

## #1 — ipanema, 2007-04-27T08:05Z

Kan någon konvertera denna kod till CDOSYS? Jag är inte så kunnig på det här.

\<%
Dim myMail, namn, telefon, email, meddelande

namn = request.form("namn")
telefon = request.form("telefon")
email = request.form("email")
meddelande = request.form("meddelande")

 Set myMail = CreateObject("CDONTS.NewMail")
 myMail.From = request.form("email")
myMail.Subject="Kontaktsidan"
myMail.To = "test@ipanema.nu"
myMail.Body="Namn: " & namn & vbNewline & vbNewline & "Telefon: " & telefon & vbNewline & "Email: " & email & vbNewline & "Meddelande: " & meddelande
myMail.Send
set myMail=nothing
%\>

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

## #2 — Zaiman, 2007-04-27T08:50Z

Här kommer ett exempel (något gammal som jag knåpat ihop nån gång):

```
		' send by connecting to port 25 of the SMTP server
		Dim iMsg
		Dim iConf
		Dim Flds
		Dim strHTML
		Dim strSmartHost
		Dim obj

		Const cdoSendUsingPort = 2
		StrSmartHost = "min.mailserver.nu"

		set iMsg = CreateObject("CDO.Message")
		set iConf = CreateObject("CDO.Configuration")

		Set Flds = iConf.Fields

		' set the CDOSYS configuration fields to use port 25 on the SMTP server

		With Flds
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = Basic
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "dittanvändarnamn"
		.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "dittlösenord"
		.Update
		End With

		' build for message body
		sBody = Request.Form("meddelande")
			'For Each field In Request.Form
			'	sBody = sBody & field & ": " & Request.Form(field) & Chr(13) & Chr(10)
			'Next

		' apply the settings to the message
		With iMsg
		Set .Configuration = iConf
		.To = "till@nagon.se"
		.From = Request.Form("epost")
		.Subject = "Meddelande från Dig"
		.TextBody = sBody
		.Send
		End With

		' cleanup of variables
		Set iMsg = Nothing
		Set iConf = Nothing
		Set Flds = Nothing
```

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

## #3 — ipanema, 2007-04-27T09:08Z

Tack för snabbt svar men hur gör jag (helt okunnig) med:
namn = request.form("namn")
telefon = request.form("telefon")
email = request.form("email")
meddelande = request.form("meddelande")

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

## #4 — Zaiman, 2007-04-27T09:51Z

Oj..
Börja här:
<http://iwtjanster.idg.se/webbstudio/pub/artikel.asp?id=93>

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/159691-cdonts-till-cdosys
