Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 30th, 2003, 03:37 PM
Registered User
 
Join Date: Oct 2003
Location: , , Canada.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default newer programmer needs assistance

Does anyone know how to send an outlook task from an asp page to someones mail box? in exchange

Reply With Quote
  #2 (permalink)  
Old October 31st, 2003, 01:34 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

check thid code this is help to you
'''''''page name=contactus.asp''''''''''''''''''''''''''
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script language="JavaScript">
<!--
function onSubmit1()
{
if (document.form1.txtContactName.value=="")
{
    alert("Please Enter the Contact Name")
    document.form1.txtContactName.focus()
    return;
}
 if ((document.form1.txtEmail.value == "")&&(document.form1.txtFax.value == "")&&(document.form1.txtTel.value == ""))
  {
    alert("Please enter a value for E mail / Phone / Fax");
     document.form1.txtTel.focus();
    return;
  }



   if (document.form1.txtEmail.value!= "")
  {
 var mail1=document.form1.txtEmail.value;
  var i1 = mail1.indexOf('@');
   var i2 = mail1.lastIndexOf('@');
   var i3 = mail1.indexOf('.');
  if (mail1.length<=5)
  {
  alert("Your E-mail address is too small");
   document.form1.txtEmail.focus();
  return;
   }

    if(i1==-1)
 {
  alert(" E-mail address must have a '@' ");
   document.form1.txtEmail.focus();
 return;
  }

   if (i3+1==mail1.length)
  {
 alert(" E-mail address cannot contain '.' in end");
  document.form1.txtEmail.focus();
  return;
 }

  if(i1!=i2)
{
 alert(" E-mail address cannot contain two '@' signs");
  document.form1.txtEmail.focus();
 return;
  }
}


if (document.form1.txtEmail.value!= "")
{
     var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎ ÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçè êëìíîïðñòóôõöøùúûüýþ012345678 9-_.@";
    var checkStr = document.form1.txtEmail.value;
    var allValid = true;
    for (i = 0;i<checkStr.length;i++)
    {
        ch = checkStr.charAt(i);
        for (j = 0; j < checkOK.length; j++)
        if (ch == checkOK.charAt(j))
            break;
        if (j == checkOK.length)
        {
            allValid = false;
            break;
        }
    }
    if (!allValid)
    {
        alert("Please enter only letter, digit and \"@\" characters in the \"E-mail\" field.");
        document.form1.txtEmail.focus();
        return;
    }

}
if(document.form1.txtEnquire.value=="")
{
    alert("Please Enter the Message");
    document.form1.txtEnquire.focus ();
    return;
}
else
{
document.form1.mode.value="mailit"
document.form1 .action ="contactus.asp"
document.form1 .submit ();
}
}
//-->
</script>
</head>
  <%
    mode=Request("mode")
%>
<body topmargin="0" leftmargin="0" >
<%if mode<>"mailit" then%>
   <form method="post" name="form1">
  <table border="0" width="100%" height="" cellpadding="0" cellspacing="0" bordercolor=red>
  <tr>
    <td width="4%" height="15">&nbsp;</td>
        <td width="16%" height="15" colspan="3" align="center" >
        <table width="100%" border=0 bordercolor=red>
        <td width="33%"></td>
        <td width="33%" align=center><b>Contact us</b> </td>
        <td width="33%" align=right><a href="default.htm"><img border="0" src="images/home.gif" width="44" height="21"></a> </td>
        </table>
        </td>

      <td width="4%" height="15">&nbsp;</td>
    </tr>
     <tr>
      <td width="4%" height="15">&nbsp;</td>
      <td width="16%" height="15" colspan="3" align="center" >&nbsp;</td>
      <td width="4%" height="15">&nbsp;</td>
    </tr>
        <tr>
      <td width="4%" height="15">&nbsp;</td>
      <td width="16%" height="15" colspan="3"></td>
      <td width="4%" height="15">&nbsp;</td>
    </tr>
    <tr>
     <td width="4%" >&nbsp;</td>
      <td width="26%" >Contact Name</td>
      <td width="2%" >:</td>
      <td width="63%" ><input size=35 name="txtContactName" style="border: 1 solid #008000">&nbsp;*</td>
      <td width="4%"></td>
    </tr>
    <tr>
     <td width="4%" >&nbsp;</td>
      <td width="26%" >Company</td>
       <td width="2%" >:</td>
      <td width="63%"><input size=35 name="txtCompany" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >Address </td>
     <td width="2%" >:</td>
      <td width="63%" ><input size=35 name="txtAddress1" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" height="27" >City</td>
      <td width="2%" >:</td>
      <td width="63%" height="27"><input size=35 name="txtAddress2" style="border: 1 solid #008000"></td>
      <td width="4%" height="27">&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >County</td>
       <td width="2%" >:</td>
      <td width="63%" ><input size=35 name="txtAddress3" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >Post Code&nbsp;&nbsp;&nbsp;
            </td>
     <td width="2%" >:</td>
          <td width="63%" ><input size=20 name="txtPostCode" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >Tel</td>
       <td width="2%" >:</td>
      <td width="63%" ><input size=20 name="txtTel" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >Fax</td>
       <td width="2%" >:</td>
      <td width="63%" ><input size=20 name="txtFax" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
    <td width="4%" >&nbsp;</td>
      <td width="26%" >E mail</td>
      <td width="2%" >:</td>
     <td width="63%" ><input size=35 name="txtEmail" style="border: 1 solid #008000"></td>
      <td width="4%" >&nbsp;</td>
    </tr>
    <tr>
     <td width="4%" >&nbsp;</td>
      <td width="26%" >Enquiry Details</td>
      <td width="2%" >:</td>
      <td width="63%" valign="top"><TEXTAREA name=txtEnquire rows="6" cols="30" style="border: 1 solid #008000"></TEXTAREA>&nbsp;*</td>
      <td width="4%" >&nbsp;</td>
    </tr>
     <tr>
     <td width="4%" height="" >&nbsp;</td>
      <td width="26%" height="" >&nbsp;</td>
       <td width="2%" height="">&nbsp;</td>
      <td width="63%" height="">&nbsp;</td>
      <td width="4%" height="">&nbsp;</td>
    </tr>
    <tr>
      <td width="63%" height="" colspan="5" align="center" colspan="2">
     <a href="javascript:onSubmit1()"><IMG height=23 src="images/btnsubmit.GIF" width=78 border=0></a>&nbsp; </td>
    </tr>

    <tr>
        <td width="4%" height="" >&nbsp;</td>
         <td width="16%" height="" >&nbsp;</td>
          <td width="12%" height="">&nbsp;</td>
         <td width="63%" height="">&nbsp;</td>
         <td width="4%" height="">&nbsp;</td>
       </tr>
    <tr>
        <td width="4%" height="" ></td>
         <td width="91%" height="" colspan="3"></td>
         <td width="4%" height=""></td>
       </tr>

       <tr>
    <td width="4%" height></td>
    <td width="92%" height colspan=3></td>
    <td width="4%" height></td>
  </tr>
           <tr>
        <td width="4%" height="" >&nbsp;</td>
         <td width="16%" height="" >&nbsp;</td>
          <td width="12%" height="">&nbsp;</td>
         <td width="63%" height="">&nbsp;</td>
         <td width="4%" height="">&nbsp;</td>
       </tr>
  </table>
 <input class="smalltxt5" name="mode" type="hidden">
 </form>
 <%end if%>
  <%
if mode="mailit" then
    ContactName=Request("txtContactName")
    Company=Request("txtCompany")
    Address1=Request("txtAddress1")
    Address2=Request("txtAddress2")
    Address3=Request("txtAddress3")
    PostCode=Request("txtPostCode")
    Tel=Request("txtTel")
    Fax=Request("txtFax")
    Email=Request("txtEmail")
    Enquire=Request("txtEnquire")
    path=Request("HTTP_REFERER")
str=""
str=str+"<table border='0'bordercolor='red' align='center' width='90%' height='' cellpadding='0' cellspacing='0'>"
str=str+"<tr>"
str=str+"<td width='21%' align='center' colspan='3' height='23' ><b>Your mail has been send successfully</b></td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' align='center' colspan='3' height='23' ><b>Contact Us</b></td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Contact Name</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&ContactName&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"

str=str+"<tr>"
str=str+"<td width='21%' height='23'>Company</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Company&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Address</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Address1&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='27'>City</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='27'>"&Address2&"</td>"
str=str+"<td width='4%' height='27'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>County</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Address3&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Post Code&nbsp;&nbsp;&nbsp; </td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&PostCode&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Tel</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Tel&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Fax</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Fax&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>E mail</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Email&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr>"
str=str+"<tr>"
str=str+"<td width='21%' height='23'>Enquiry Details</td>"
str=str+"<td width='12%' height='23'>:</td>"
str=str+"<td width='63%' height='23'>"&Enquire&"</td>"
str=str+"<td width='4%' height='23'></td>"
str=str+"</tr></table>"



    set mail_Obg=createObject("CDONTS.newmail")
    if Email="" then
    mail_Obg.From="surendran@mail.com"
    else
    mail_Obg.From=Email
    end if
    mail_Obg.To ="surendran@mail.com"
    strtobcc="surendran@mail.com;tamileelam@mail.com"
    mail_Obg.Subject = "Enquiry"
    mail_Obg.BodyFormat=0
    mail_Obg.MailFormat=0
    mail_Obg.Body =str
    mail_Obg.Bcc = strtobcc
    mail_Obg.Importance=2
    mail_Obg.Send
    'Response.Write str
    set mail_Obg=nothing
    'msg="Sorry,unable to send mail!"
Response.Write str
end if
%>
</body>

</html>


surendran
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Assistance KramRJ C++ Programming 2 May 19th, 2007 07:24 AM
I need u guys assistance acube4real C++ Programming 1 October 20th, 2006 08:27 AM
XSLT Assistance MarkHA XSLT 0 November 7th, 2005 12:08 AM
Network Assistance DuncanFinney C# 6 August 1st, 2005 06:42 PM
PHP newer ysiline Beginning PHP 2 December 12th, 2003 11:20 AM



All times are GMT -4. The time now is 01:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.