I seem to have a problems sending an HTML formatted email, with an attachment using ASP.
I can create an HTML mail using CDONTS no problem.
I can send a plain text email with an attachment, no problem.
The problem is when I try to combine the 2. I am embedding graphics within the HTML email using the AttachURL method. I'm trying to also attach a file as a seperate attachment. When I recieve the mail a blank mail appears with 2 attachments. The first is the HTML email and the second is the attached EXE. I would like the mail to show the HTML formatted email as the initial mail and not as an attachment but this doesn't seem to work.
Any ideas?
Test code below
<%
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "
[email protected]"
objMail.To = "
[email protected]"
objMail.Subject = "Call Reference is UK1234"
objMail.AttachURL Server.MapPath("/iissamples/sub/back2.jpg"), "back2.jpg"
HTML = "<html>"
HTML = HTML & "<head><title>test</title></head>"
HTML = HTML & "<body><b>Test</b><img src=""back2.jpg""></body>"
HTML = HTML & "</html>"
objMail.AttachFile ("C:\Inetpub\iissamples\sub\back2.jpg")
objMail.BodyFormat = 0 ' 0 = HTML, 1 = Plain
objMail.MailFormat = 0 ' 0 = MIME, 1 = Text
objMail.Body = HTML
objMail.Send
Set objMail = Nothing
%>