Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 October 26th, 2004, 12:37 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to make forms sent to email presentable.

Hi,

I'm EXTREMELY new to ASP, having only encountered it last week when I started my traineeship. One of my colleagues has asked me to find some information for him on a problem he is having. He's coded a form to sent information to an email account, but when it shows up, it's just in basic text. We need to find a way to make it more presentable - suitable for a corporate situation.

Following is a section of the code he's using - part of what thinks is the area in which the modifications need to be made.

    rsDC.AddNew
    rsDC.Fields("Requestor") = Request("Requester")
    rsDC.Fields("Email") = Request("Email")
    rsDC.Fields("BookedOn") = now()
    rsDC.Fields("StartDate") = Request("StartDate")
    rsDC.Fields("EndDate") = Request("EndDate")
    rsDC.Fields("Occurrance") = Request("Occurrance")
    rsDC.Fields("StartTime") = Request("StartTime")
    rsDC.Fields("EndTime") = Request("EndTime")
    rsDC.Fields("VideoStreaming") = Request("VideoStreaming")
    rsDC.Fields("RequiredFor") = Request("RequiredFor")
    rsDC.Fields("DocCam") = Request("DocCam")
    rsDC.Fields("PowerPt") = Request("PowerPt")
    rsDC.Fields("VCR") = Request("VCR")
    rsDC.Fields("TeleConf") = Request("TeleConf")
    rsDC.Fields("Comments") = Request("Comments")
    rsDC.Fields("SentTo") = Request("SentTo")
    rsDC.Update
    ID = rsDC("ID")
    'Response.Write("ID: "&CINT(ID))

    rsDC.Close


Any help would be greatly appreciated.



 
Old October 26th, 2004, 02:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

But the code that you posted is responsible for adding the form data into database. I think you have posted the wrong code here. Is that so?

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 26th, 2004, 05:53 PM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Umm... I guess it is. Like I said, I'm extremly new at this. Here's the part that looks to me to be responsible for sending the mail itself...

Set jmail = Server.CreateObject("JMail.Message")

    jmail.AddRecipient request("SentTO"), request("SentTo")
    jmail.AddRecipient "[email protected]"
    'jmail.AddRecipientBCC "[email protected]", "lastname, firstname"
    jmail.From = "[email protected]"
    jmail.FromName = "Name 3"

        'Obviously the above addies and names have been edited due to privacy regulations and such.'

    jmail.Subject = "VIDEO CONFERENCE REQUEST"

    ' But as not all mailreaders are capable of showing HTML emails
    ' we will also add a standard text body
    jmail.Body = "Too bad you can't read HTML-mail."

    ' As only HTML formatted emails can contain inline images
    ' we use HTMLBody and appendHTML
    jmail.HTMLBody = "<html><body>"
    jmail.appendHTML "<table border=""0"" cellpadding=""5"" cellspacing=""5"">"
    For x = 1 to Request.Form.count()
                jmail.appendHTML "<tr><td><b>" &Request.Form.key(x)& "</b></td><td>" &Server.HTMLEncode(Request.Form.item(x))& "</td></tr>"
    Next

    jmail.appendHTML "</table></body></html>"

    jmail.Send("167.123.1.1")
 
Old October 27th, 2004, 02:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi there,

Take a look at this tutorial, that has information on JMail.

It uses Execute method of JMail to send mails, compared to the SEND method used in the code posted here. Also I don't see any mention about ServerAddress there in the code and it sets both BODY and HTMLBODY properties in there. I feel there should be one of those properties set in any case and not both. When you want to send HTML formatted content as mail body, you got to leave out the BODY property not set. Try out that.

As I personally, have not used JMail for mailing from ASP pages, I am not sure what is missing there. I would strongly suggest using CDONTS or CDO objects that are easy to use/code/debug with ASP.

ASP Web Based Email Using Dimac w3 JMail

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
should I use AJAX to make forms that... dabbler Ajax 3 June 24th, 2008 08:06 AM
Using Infopath email forms tapas2525 Infopath 0 October 5th, 2007 06:04 AM
Let user make forms and controls smang VB.NET 2002/2003 Basics 0 September 2nd, 2005 04:06 PM
email contact forms xeno Beginning PHP 0 July 30th, 2005 07:36 AM
How to send an email within a forms application xuqiong VS.NET 2002/2003 1 July 22nd, 2003 01:23 AM





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