Solved

Sending a form through Email to selectable address.

Posted on 2001-06-18
63
323 Views
Last Modified: 2013-12-24
Hi All,

I have crated a form to be sent as email in FrontPage 2000. Every thing works fine.

But What I need now is to send the form results to email address depending on user selection. So I added to the form a drop menu contains options and I specified values of these options as email addresses.

Now I want this form to be sent to an email address depending on drop menu selection.

Could any one help?

Thanks all,
SAS
0
Comment
Question by:alsaeed_s
  • 32
  • 24
  • 7
63 Comments
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6201906
If your server supports ASP you can try this:

In your form properties-->options dialog, in the email results tab put this  <%request.form("Email")%>  (where Email is the name of your drop menu)


Or

In the same place try:

document.FrontPage_Form1.Email
(where your form is called Form1 and the field is email)


Let me know if either of these are successful for you.
0
 

Author Comment

by:alsaeed_s
ID: 6205005
Hi ClassyLinks,

Non of them worked..

Any help..

Thanks,
SAS
0
 

Author Comment

by:alsaeed_s
ID: 6205099
By the way, my form extension is .HTM and not .ASP and it works for direct email address but when I change it to .ASP it doesn't work providing that my server supports ASP.

Does extension make difference for a form to be sent by email??
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206130
if you are using the FP form wizard and your sever has FP extensions you can use the .htm extension on your pages.

Please post the code for your form and let me take a peek.
0
 

Author Comment

by:alsaeed_s
ID: 6206215
This is the form code..

<form method="POST" action="--WEBBOT-SELF--" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)">
        <!--webbot bot="SaveResults" startspan U-File="TicketLog.txt"
        S-Format="HTML/BR" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
        S-Email-Format="TEXT/PRE" B-Email-Label-Fields="TRUE"
        B-Email-ReplyTo-From-Field="TRUE" S-Email-ReplyTo="Email"
        B-Email-Subject-From-Field="FALSE"
        S-Email-Subject="Computer Troble Ticket"
        S-Builtin-Fields="REMOTE_NAME REMOTE_USER"
        S-Email-Address="<%request.form("Email")%>" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot
        bot="SaveResults" endspan -->
        <table border="0" width="130%">
          <tr>
            <td width="22%" align="left"></td>
            <td width="79%"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Badge No.</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="Badge" size="20"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Name</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="Name" size="60"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Job Title</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="JobTitle" size="36"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Email</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="Email" size="60"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Department</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              B-Disallow-First-Item="TRUE" --><select size="1" name="Department">
                <option selected>Select the Department</option>
                <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">EWPD
                (Admin)</option>
                <option value="PipelinesEWPDComputerSuppport@exchange.aramco.com.sa">EWPD
                (Pumpstations)</option>
                <option value="PipelinesSAPDComputerSuppport@exchange.aramco.com.sa">SAPD</option>
                <option value="PipelinesNAPDComputerSuppport@exchange.aramco.com.sa">NAPD</option>
                <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">PTSD</option>
              </select></td>
          </tr>
          <tr>
            <td width="22%" align="left">Supervisor Name</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="SupervisorName" size="20"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Supervisor Email</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="SupervisorEmail" size="20"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Telephone</td>
            <td width="79%"><input type="text" name="Telephone" size="20"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Location</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              B-Disallow-First-Item="TRUE" --><select size="1" name="Area">
                <option selected>Select an Area</option>
                <option>EWPD Area I</option>
                <option>EWPD Area II</option>
                <option>EWPD Area III</option>
                <option>Dha B-3175</option>
                <option>Abqaiq</option>
                <option>Dha B-3150</option>
              </select></td>
          </tr>
          <tr>
            <td width="22%" align="left">Equipment ID</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="EquipmentID" size="20"></td>
          </tr>
          <tr>
            <td width="22%" align="left">Vendor of the equipment&nbsp;</td>
            <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
              --><input type="text" name="Vendor" size="20"> Such As (IBM, Dell,
              HP, ..ect)</td>
          </tr>
          <tr>
            <td width="22%" valign="top" align="left">
              <p align="center">Trouble Brief Description</p>
            </td>
            <td width="79%"><textarea rows="2" name="description" cols="45"></textarea></td>
          </tr>
          <tr>
            <td width="22%" align="left"></td>
            <td width="79%"></td>
          </tr>
          <tr>
            <td width="22%" align="left"></td>
            <td width="79%"></td>
          </tr>
          <tr>
            <td width="22%" align="left"></td>
            <td width="79%"><input type="submit" value="Submit" name="Action"></td>
          </tr>
        </table>
      </form>
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206248
The ="<%request.form("Email")%> won't work if you can't support email.

Which form field are you trying to capture as the destination address??  Is it Email??
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206276
Also, you have no values specified for your second drop down field.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206287
You want the email to go to the value in the Department field, correct??
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206304
Try This:

<form method="POST" action="--WEBBOT-SELF--" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)">
       <!--webbot bot="SaveResults" startspan U-File="TicketLog.txt"
       S-Format="HTML/BR" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
       S-Email-Format="TEXT/PRE" B-Email-Label-Fields="TRUE"
       B-Email-ReplyTo-From-Field="TRUE" S-Email-ReplyTo="Email"
       B-Email-Subject-From-Field="FALSE"
       S-Email-Subject="Computer Troble Ticket"
       S-Builtin-Fields="REMOTE_NAME REMOTE_USER"
       S-Email-Address="document.FrontPage_Form1.Department" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot
       bot="SaveResults" endspan -->
       <table border="0" width="130%">
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Badge No.</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Badge" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Name</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Name" size="60"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Job Title</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="JobTitle" size="36"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Email</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Email" size="60"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Department</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            B-Disallow-First-Item="TRUE" --><select size="1" name="Department">
               <option selected>Select the Department</option>
               <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">EWPD
               (Admin)</option>
               <option value="PipelinesEWPDComputerSuppport@exchange.aramco.com.sa">EWPD
               (Pumpstations)</option>
               <option value="PipelinesSAPDComputerSuppport@exchange.aramco.com.sa">SAPD</option>
               <option value="PipelinesNAPDComputerSuppport@exchange.aramco.com.sa">NAPD</option>
               <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">PTSD</option>
             </select></td>
         </tr>
         <tr>
           <td width="22%" align="left">Supervisor Name</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="SupervisorName" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Supervisor Email</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="SupervisorEmail" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Telephone</td>
           <td width="79%"><input type="text" name="Telephone" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Location</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            B-Disallow-First-Item="TRUE" --><select size="1" name="Area">
               <option selected>Select an Area</option>
               <option>EWPD Area I</option>
               <option>EWPD Area II</option>
               <option>EWPD Area III</option>
               <option>Dha B-3175</option>
               <option>Abqaiq</option>
               <option>Dha B-3150</option>
             </select></td>
         </tr>
         <tr>
           <td width="22%" align="left">Equipment ID</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="EquipmentID" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Vendor of the equipment&nbsp;</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Vendor" size="20"> Such As (IBM, Dell,
             HP, ..ect)</td>
         </tr>
         <tr>
           <td width="22%" valign="top" align="left">
             <p align="center">Trouble Brief Description</p>
           </td>
           <td width="79%"><textarea rows="2" name="description" cols="45"></textarea></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"><input type="submit" value="Submit" name="Action"></td>
         </tr>
       </table>
     </form>
0
 

Author Comment

by:alsaeed_s
ID: 6206308
Actually, I tried for some fields including email field..

But Originally, I want to get the destination email from Department field..

I tried ="<%request.form("Department")%> but it didn't work too..

0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206319
see above.
0
 

Author Comment

by:alsaeed_s
ID: 6206364
ClassyLinks,

I tried what you posted.. I get the conformation page (No errors) but the email wasn't sent.

What do you think the problem is??

Thanks
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206410
hmmmm...ok, so we are half-way there.  If you aren't getting any errors, we at least haven't offended the server  8-)

OTOH....no errors makes it harder to debug.

Silly Question:  Are you sure that the email wasn't sent?  It could take a few minutes for FP to communicate with the email server and then the server to send the message.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6206635
Hi...


I just found this on another site...it looks doubtful to me, but give it a try for a second.

Put this in your Email Results box:  [Department]

Does it work?
0
 

Author Comment

by:alsaeed_s
ID: 6209096
Hi ClassyLink..

This way gives an error:

FrontPage Error.
User: please report details to this site's webmaster.


Webmaster: please see the server's application event log for more details.

and I gives an application event:

Microsoft FrontPage Server Extensions:
   http://plweb2 - Error #160005 Message: Bad response from SMTP host'ntdhapmx02': 553 malformed address: <[Department]> .
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6210121
ok..so that doesn't parse the field...I didn't think it would.

the document.frontpage_form1.department should work.

Let up upload your form to my server and try it from there....I'll just insert my address into it and see what happens.
0
 

Author Comment

by:alsaeed_s
ID: 6210244
Hi ClassyLinks..
Waiting for your feedback..

Thanks for help..
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6215651
ok...try this:

theForm.Department.value
0
 

Author Comment

by:alsaeed_s
ID: 6220862
Hi ClassyLinks,

I have found out that the system accepts any expression with dots like:
form1.department
a.b.c
yes.no.hi

It seems that the server accepts these because he thinks that they are email addresses. So we need to find a way to tell the server that this expression is a field name and not email address.

Thanks

SAS


0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6222672
theForm.Department.value doesn't work??  It is telling the server to take the email value from the form field named Department.
0
 

Author Comment

by:alsaeed_s
ID: 6222722
I tried it but it doesn't work!!

It seems that it does not know that this is a field name.. and not an email address.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6222742
Sure it does....it just isn't grabbing the value maybe.  There is no documentation on this on any MS site....that's why it's taking so long to figure it out for you.  The above works for others I have helped here in EE, so I am perplexed.

I wish it would give the 533 error again so that we can see what value it is pulling.

I'm thinking what we might have to do here is create a javascript to do this address rather than letting FP do it.  Obviously it doesn't want to cooperate!
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6232056
alsaeed...what do you want to do???
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6235408
Instead of setting the action with frontpage...you'd better handle that with the FrontPage_Form1_Validator(theForm) function

Example:

function FrontPage_Form1_Validator(theForm)
{
// The original lines of the code go here..

// Somewhere here you would check if the email address inputted is valid

// If it is.... and assuming the field containing the
// email address is called "email"

theForm.action = theForm.email.value;
theForm.submit();
}

Cheers,
Max.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6235521
Hi Dreamy...ummmm....how exactly would alsaeed do that in the FP form results dialog box??  ;-)

That is the problem.

The field is called Department.

Therefore, the value we are trying to pull is theForm.Department.value - which is what I have suggested be put into the email results box of the wizard.

However, alsaeed says that this isn't working.

Do you have any other non-FP suggestions???

I'd like to use ASP, but alsaeed cannot.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6244950
alsaeed....no response from you for over a week.  How's it going?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6255208
alsaeed....please respond.  EE is only helpful if you respond to all suggestions, even if it is only to tell us it still isn't working.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6264871
alsaeed....are you there?
0
 

Author Comment

by:alsaeed_s
ID: 6268708
Hi all,
 Sorry for this delay..

I has some problems in my email so that I didn't know about the new added comments..

Still I could not find a solution for that..
I 'll try Dream Master solution and get back to you shortly

Saeed
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6268723
*nods*

Ok....Classy and I will wait...

Max.
0
 

Author Comment

by:alsaeed_s
ID: 6268751
Hi All,

Where can I find "FrontPage_Form1_Validator" function?

I found that it being referenced by the form as follows:
onsubmit="return FrontPage_Form1_Validator(this)
But where is it?

Any comments?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6268806
That's the problem alsaeed....you don't have any way to mess with that.  The validator script isn't "written" until you publish the page.  You won't find it anywhere in the HTML prior to publishing.
0
 

Author Comment

by:alsaeed_s
ID: 6268838
I normally edit my Web site from the web server directly.. do I need to publish it??

alSaeed
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6268877
You edit it "live" on the server?  That should serve the same function as publishing.  Just as long as you are not editing it locally and only ftping it....this form wizard will not work that way.
0
 

Author Comment

by:alsaeed_s
ID: 6268973
Yes, I am working on the service (Live)..
What should I do to view that function if it's needed?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6273537
To view "FrontPage_Form1_Validator" function  You would have to edit in notepad directly and forget about using FP to make any changes.
0
 

Author Comment

by:alsaeed_s
ID: 6281853
DreamMaster,

I added the two lines below you provided to the function FrontPage_Form1_Validator(theForm):
theForm.action = theForm.email.value;
theForm.submit();

But I get nothing!

...
I'm still stuck..
0
 

Author Comment

by:alsaeed_s
ID: 6281855
50 points more..
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6281992
alsaeed..

Adding points to this question isn't the answer.

Are you prepared to do this page ENTIRELY in notepad and not open it again in FP?  Are you prepared to DITCH the FP wizard so that we can do this manually?

If the answer to the above is YES, then we can help.  Otherwise we cannot mess with the code that FP spits out.
0
 

Author Comment

by:alsaeed_s
ID: 6283035
ClassyLinks,

I added more points because you are paying allot of effort to help, so I think it is your right to get more point as you spend more time.. Isn't it??

The answer to your questions is Yes, I can use notepad instead.

Thanks
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6283456
Ok...you can use notepad...great!

<I just made the comment about points because I don't want you locking up points and not being able to ask other questions if this takes us a while.  Just an opinion, but my general way to handle the point thing when I am a questioner is to increase the points when I accept the answer.  I may mention it along the way, but if a question is worth this many points and the Experts are sticking with you <wink> they won't go away after x number of days, no matter what the points are.>

I know you cannot use ASP, so we will have to do this with javascript.

Dreamy, you surpass me in the JS area.....before I start plugging away, do you have any ideas??
0
 

Author Comment

by:alsaeed_s
ID: 6284591
My server supports ASP.. so It can be used.



0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6284872
If you can use Notepad (or any other editor besides FP for that matter I would almost suggest rewriting the entire Form page...as you certainly don't want to be messing with the FP code trying to change that.....

If you could show a link to where I can find the form...explain exactly what needs to be done on submitting the form I will rewrite the code for you explaining exactly what happens...

Max.
0
 

Author Comment

by:alsaeed_s
ID: 6285045
The form is posted on the top of this question.
I want basically to send the form results to an email address depending on user selection.
For example
I added a drop menu to the form allowing user to specify his/ her department.
So, If the user from department A, the from will be sent to email address X
If department is B, the email will be sent to address Y and so on.

That is the whole idea
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6285065
Ok...as soon as I have some time I will be working on this for you... :-)

Max.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6293943
Alsaeed...looking for a server side solution here.  I know you don't have ASP, but do you have access FormMail??
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6294094
He does have ASP Classy...look at his later comments..

Max.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6294155
This thread is getting too long for my little blonde brain.

Alsaeed, can you use ASP?  If you can and your server has CDONTS, we can avoid this whole disaster.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6294196
Yes...simply post to a new ASP page that will send the email using the CDONTS object very easy...

Max.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6294216
Exactly.  Then we can stop trying to force a FP component to do something it was never intended for.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6294577
Put into your original page

<form action="sendMail.asp">

and in sendMail.asp:
======================

<%
 Dim objMail
 Set objMail = server.createobject("CDONTS.NewMail")
 objMail.Send("me@company.com", "you@company.com", "Hello", _
                  "I sent this in 3 statements!", 0)
 Set objMail = nothing
%>

Max.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6294965
Change the page to form.asp.

If your server supports CDONTS & ASP, this should work for you.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Badge No</title>
</head><%
Select Case Request.QueryString("action")
      Case "save"

            
            SendEmailNotification
                                 
                           
'Now, we give them the option of returning to your home page.
    %>


<body topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">
<p></P><P align="center">
    <%response.write"<I>Your trouble ticket has been submitted.   We will respond ASAP.<br><br><A HREF='http://yourhomepage.com'>Click here to go back to the Home Page</I></A></p>"
   
      Case Else
%>

<form method="POST" action="form.asp?action=save" onSubmit="return FrontPage_Form1_Validator(this)">
              <table border="0" width="130%">
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Badge No.</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Badge" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Name</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Name" size="60"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Job Title</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="JobTitle" size="36"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Email</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Email" size="60"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Department</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            B-Disallow-First-Item="TRUE" --><select size="1" name="Department">
               <option selected>Select the Department</option>
               <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">EWPD
               (Admin)</option>
               <option value="PipelinesEWPDComputerSuppport@exchange.aramco.com.sa">EWPD
               (Pumpstations)</option>
               <option value="PipelinesSAPDComputerSuppport@exchange.aramco.com.sa">SAPD</option>
               <option value="PipelinesNAPDComputerSuppport@exchange.aramco.com.sa">NAPD</option>
               <option value="pipelinesB-3150ComputerSupport@exchange.aramco.com.sa">PTSD</option>
             </select></td>
         </tr>
         <tr>
           <td width="22%" align="left">Supervisor Name</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="SupervisorName" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Supervisor Email</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="SupervisorEmail" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Telephone</td>
           <td width="79%"><input type="text" name="Telephone" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Location</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            B-Disallow-First-Item="TRUE" --><select size="1" name="Area">
               <option selected>Select an Area</option>
               <option>EWPD Area I</option>
               <option>EWPD Area II</option>
               <option>EWPD Area III</option>
               <option>Dha B-3175</option>
               <option>Abqaiq</option>
               <option>Dha B-3150</option>
             </select></td>
         </tr>
         <tr>
           <td width="22%" align="left">Equipment ID</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="EquipmentID" size="20"></td>
         </tr>
         <tr>
           <td width="22%" align="left">Vendor of the equipment&nbsp;</td>
           <td width="79%"><!--webbot bot="Validation" B-Value-Required="TRUE"
            --><input type="text" name="Vendor" size="20"> Such As (IBM, Dell,
             HP, ..ect)</td>
         </tr>
         <tr>
           <td width="22%" valign="top" align="left">
             <p align="center">Trouble Brief Description</p>
           </td>
           <td width="79%"><textarea rows="2" name="description" cols="45"></textarea></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"></td>
         </tr>
         <tr>
           <td width="22%" align="left"></td>
           <td width="79%"><input type="submit" value="Submit" name="Action"></td>
         </tr>
       </table>
     </form><%

' This part specifies the format and contents of the email message

Sub SendEmail(strFrom, strTo, strSubject, strBody)
      ' DB and email object vars for email notification
      Dim objCDOMail

            Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

            objCDOMail.From = strFrom
            objCDOMail.To = strTo
            objCDOMail.Subject = strSubject
            objCDOMail.Body = strBody

            ' Send the message!
            objCDOMail.Send
            Set objCDOMail = Nothing
End Sub ' SendEmail


Sub SendEmailNotification()
      
      SendEmail _
                                    "request.form('email')", "request.form('Department')", "A new trouble ticket has been submitted.", _
                                    "Please address this issue:" & vbcrlf &_
                                    "Badge No:  & request.form("Badge") & vbcrlf &_
                                    "Name:  & request.form("Name") & vbcrlf &_
                                    "Job Title:  & request.form("JobTitle") & vbcrlf &_
                                    "Supervisor Name:  & request.form("SupervisorName") & vbcrlf &_
                                    "Telephone:  & request.form("Telephone") & vbcrlf &_
                                    "Location:  & request.form("Location") & vbcrlf &_
                                    "Equipment ID:  & request.form("EquipmentID") & vbcrlf &_
                                    "Vendor:  & request.form("Vendor") & vbcrlf &_
                                    "Description of problem:" & vbcrlf
                                    request.form("description") & vbcrlf
                                    

End Sub 'SendEmailNotification

End Select
%>
 </body>

</html>

The only line I'm worried about is:

"request.form('email')", "request.form('Department')", "A new trouble ticket has been submitted.", _


It may need to be changed to:
"&request.form('email')&", "&request.form('Department')&", "A new trouble ticket has been submitted.", _

To get it to work or we may need to do this:

email = request.form("email")
department = request.form("department")

And then use:

"&email&", "&department&", "A new trouble ticket has been submitted.", _
0
 

Author Comment

by:alsaeed_s
ID: 6304378
Classy,

I tried this form and all three options you supplied, but I got an error message:

Technical Information (for support personnel)

Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/asp_ticket2.asp, line 151
"&email&", "&department&", "A new trouble ticket has been submitted.", _

and every time I change the descried live it displays it in the error message.
0
 
LVL 7

Accepted Solution

by:
ClassyLinks earned 300 total points
ID: 6304633
Sorry.

That

Send Email_ should read:

request.form("email"), request.form("department"), "A new trouble ticket has been submitted.", _
                              "Please address this issue:" & vbcrlf &_
                              "Badge No: " & request.form("Badge") & vbcrlf &_
                              "Name: " & request.form("Name") & vbcrlf &_
                              "Job Title:  "& request.form("JobTitle") & vbcrlf &_
                              "Supervisor Name:  "& request.form("SupervisorName") & vbcrlf &_
                              "Telephone:  "& request.form("Telephone") & vbcrlf &_
                              "Location:  "& request.form("Location") & vbcrlf &_
                              "Equipment ID:  "& request.form("EquipmentID") & vbcrlf &_
                              "Vendor:  "& request.form("Vendor") & vbcrlf &_
                              "Description of problem:" & vbcrlf &_
                              request.form("description") & vbcrlf


You can test it at http://classylinks.ca/alsaeed/form.asp
0
 

Author Comment

by:alsaeed_s
ID: 6304691
Thanks Classy..

My email server is down now..

Once it's back, I'll try it and get back to you..

Alsaeed
0
 

Author Comment

by:alsaeed_s
ID: 6308307
Hi Classy,

I copied the form you made to my web server but when I click Submit, I get the form again with empty fields instead of viewing the (feedback form that you wrote) and the email was not sent.

Did I do mistake?

Thanks again Classy
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6308350
Questions:

Did you save it as .asp?
Does your server have CDONTS?
Did you try it on my site?  Did the email get to you from there?
Do you want me to send it to you by email?
0
 

Author Comment

by:alsaeed_s
ID: 6309132
1. Yes, it is as .asp.
2. I don't know. How do I check for CDONTS?
3. Yes. I tried it on yours, but I did get any emails!

Thank you.

 
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6309280
3. Yes. I tried it on yours, but I did get any emails!

You did or didn't??

Are your email addresses in the form correct? pipelinesB-3150ComputerSupport@exchange.aramco.com.sa

Ask your server admin about the CDONTS....the email section will not work without them.....however, if they are not installed, you would get an error stating that it couldn't create the object.  That is IF you can process ASP at all.  The fact that the script isn't even giving you the confirmation message leads me to believe that it is not processing any of the ASP.

As you will see, the one I posted on my server has an additional option in the email addresses section.  It sends an email to me.  Try it and I will post here when I get the email, or I can forward it to you.
0
 

Author Comment

by:alsaeed_s
ID: 6309457
Sorry for this misspelled word.
I didn't receive any emails.

I am sure that my server supports ASP but I have no idea about CDONTS.

Could you please tell me how to check for CDONTS since I have administrative privileges on my web server.

Thanks

0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6309955
I am not an administrator....but I do know that you need IIS 4 (at least) to run CDONTS.  It is usually an addition to your SMTP service.
0
 

Author Comment

by:alsaeed_s
ID: 6311310
Classy,

Thank you very Much
It works!!!

The problem was when I tried to view the form source (trough IE) that you linked to your website it doesn't show the complete source for the form.. so that I get incomplete form.

But what I did is copying the form your posted then copy the modification you made later.

Thank you again
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6312059
Great!  Glad we finally got it working.  And remember that you can never view the source code of an ASP file in IE.  ASP code is parsed into HTML, so it is hidden from the viewer.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now