webForumDet fria alternativet

HTML-mail med CDONTS

ASPur ASP

2 svar · 306 visningar · startad av Wiberg

WibergMedlem sedan juni 20003 169 inlägg
#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. :(

sawMedlem 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.

WibergMedlem sedan juni 20003 169 inlägg
#3

Tack!

129 ms totalt · 3 externa anrop · v20260731065814-full.29ac60f6
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
126 ms — hämta tråd, inlägg och bilagor (db)