webForumDet fria alternativet
Logga in / Bli medlem

HTML-mail med CDONTS

ASP

2 svar · 306 visningar · startad av Wiberg

Medlem sedan juni 20003 169 inlägg
Trådstart#1
 <%
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. :(

Medlem sedan mars 20011 880 inlägg
#2

Du måste lägga till detta:

ObjSendMail.BodyFormat = 0
ObjSendMail.MailFormat = 0

Då får du HTML-formaterad mailformat.

Medlem sedan juni 20003 169 inlägg
#3

Tack!

253 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91
124 ms — deklarationer (db)
0 ms — hämta statistik (cache)
126 ms — hämta tråd, inlägg och bilagor (db)
124 ms — ändringar (db)