Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2003, 06:19 AM
Authorized User
 
Join Date: Jul 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inline images and mail attachments

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
%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
E-Mail Attachments kidbass Beginning VB 6 0 October 26th, 2006 06:30 AM
Mail with Attachments software_developer_kk Classic ASP Basics 1 March 31st, 2005 12:34 AM
Mail_IMAP->filename for inline attachments? kg Pro PHP 2 November 7th, 2004 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.