Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP CDO
|
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 May 3rd, 2004, 12:53 PM
id7 id7 is offline
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to assemble fields into a body element in ASP

Okay -- I have created numerous HTML forms and used Formmail to send them under Unix. Now I have a client whose hosting package is limited to Windows 2003 server and ASP. The only way I can send form email is through CDO.

Using some of the ASP scripts I have found online, I can succesfully send a email form through CDO under ASP. That is great, however, it appears that CDO is limited to the fields I can use -- To, From, Subject, Body, etc. unlike Formmail which will process any form field you throw at it. It appears that I have to assemble any additional fields into a text block that can be sent through the body element. This is where I am stuck. I am trying to add additional fields as follows:

objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = "Name: " & Name & vbCrLf & _
" Phone: " & Phone & vbCrLf & _
Body & vbCrLf & "."
objCDO.Send

When I attempt to send via this script I get an "Invalid Visibility" error in the objCDO.Send line.


If I reduce the code so that the objCDO.TextBody line reads:

objCDO.TextBody = Body

then the script works fine and will send a11 the elements via eMail.

My client wants the Name and Phone fields to be included in the body element. Can anybody suggest how to assemble the aa so it can be sent in the body element?

 
Old July 13th, 2004, 12:45 AM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Friends,
Here I am giving the small example which working fine for CDONTS

SET myMail = Server.CreateObject("CDONTS.Newmail")

    myMail.From = strFrom
    myMail.To = strTo

    myMail.Subject = strSubject
    myMail.BodyFormat = 1 ' CdoMailFormatText
' here the strMessage contain the formatted message
    myMail.Body = strMessage

    myMail.Send

    SET myMail = Nothing
I hope you will find your solution

Sunil Yenpure






Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for body element in an html not working aldwinenriquez XML 8 August 28th, 2008 05:56 AM
Properties box for the body element -- Page 40-41 zcorker ASP.NET 1.0 and 1.1 Basics 3 October 25th, 2007 01:14 AM
Master Page Body Element Properties SomeoneKnows BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 August 10th, 2007 04:13 PM
Can I use assemble language in C#? and How? bnusz_cn BOOK: Professional C#, 2nd and 3rd Editions 1 July 13th, 2004 07:47 PM





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