---
title: "HTML-mail med CDONTS"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/40546-html-mail-med-cdonts"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Wiberg"
published: "2002-03-30T12:05:33.000Z"
updated: "2002-03-30T13:13:36.000Z"
replies: 2
views: 306
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/40546-html-mail-med-cdonts"
---

# HTML-mail med CDONTS

## #1 — Wiberg, 2002-03-30T12:05Z

```
 <%
titel = request.querystring("titel")
bild = request.querystring("bild")

set fso = createobject("scripting.filesystemobject") 
set act = fso.opentextfile(server.mappath("mail.htm")) 

for i = 1 to 20
html = html & act.readline
next

html = replace(html, "%titel%", titel)
html = replace(html, "%bild%", bild)

if request.querystring("send") = 1 then

Set ObjSendMail = CreateObject("CDONTS.NewMail")

With ObjSendMail
.From = "no-reply@shapelab.org"
.To = "wiberg@ingen.info"
.BodyFormat = cdoBodyFormatHTML
.subject = "hej hopp"
.Body = html
.Send
End With

response.write("done")

Set ObjSendMail = Nothing

end if
%>
```

Mailet skickas men inte som HTML utan bara som vanlig text. :(

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

## #2 — saw, 2002-03-30T12:09Z

Du måste lägga till detta:

```
ObjSendMail.BodyFormat = 0
ObjSendMail.MailFormat = 0
```

Då får du HTML-formaterad mailformat.

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

## #3 — Wiberg, 2002-03-30T13:13Z

Tack!

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/40546-html-mail-med-cdonts
