[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 767
  • Last Modified:

Can't get my form page to send emails

Hello,

Can anyone tell me what is wrong with this code? I get redirect to the correct location upon submit, but the email never gets sent out. Please assume for now that the login info for the smtp server is valid.

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="WA_Universal_Email/CDOSYS_JS.asp" -->
<!--#include file="WA_Universal_Email/MailFormatting_JS.asp" -->
<%
function WA_Universal_Email_1_SendMail(RecipientEmail)      {
  var MailAttachments = "";
  var MailBCC         = "";
  var MailCC          = "";
  var MailTo          = "";
  var MailBodyFormat  = "";
  var MailBody        = "";
  var MailImportance  = "";
  var MailFrom        = "info@maxgeekpc.com";
  var MailSubject     = "Thanks for your interest";

  //Global Variables
  gAddBCC = "";
  gAddCC = "";
  gAddRecipient = "";
  gBodyFormat = "";
  gSetImportance = "";

  WA_MailObject = WAUE_Definition("smtp.1and1.com","25","","xxxxxxxx-xx","******");

  if (RecipientEmail)     {
    WA_MailObject = WAUE_AddRecipient(WA_MailObject,RecipientEmail);
  }
  else      {
    //To Entries
    WA_MailObject = WAUE_AddRecipient(WA_MailObject,"volk3volk@comcast.net");
    MailTo = gAddRecipient;
  }

  //Attachment Entries

  //BCC Entries
  MailBCC = gAddBCC;

  //CC Entries
  MailCC = gAddCC;

  //Body Format
  WA_MailObject = WAUE_BodyFormat(WA_MailObject,0);
  MailBodyFormat = gBodyFormat;

  //Set Importance
  WA_MailObject = WAUE_SetImportance(WA_MailObject,"3");
  MailImportance = gSetImportance;

  //Start Mail Body
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<font size=\"-1\" face=\"Arial, Helvetica, sans-serif\"><img src=\"http://www.eaglecrossingcolorado.com/img/eagle_crossing_logo.jpg\" width=\"300\" height=\"116\"></font><br>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<p><font size=\"-1\" face=\"Arial, Helvetica, sans-serif\"><font size=\"3\">Dear  </font> </font></p>\r\n";
MailBody = MailBody + "<P align=left><font size=\"-1\" face=\"Arial, Helvetica, sans-serif\"><br>\r\n";
MailBody = MailBody + "      <strong>Thank you for your interest in <font color=\"#FF0000\" size=\"3\">Eagle Crossing</font>. </strong></font></P>\r\n";
MailBody = MailBody + "<p><strong><font size=\"-1\" face=\"Arial, Helvetica, sans-serif\">One of our advisors will be contacting you shortly.</font></strong></p>\r\n";
MailBody = MailBody + "<p><strong><font size=\"-1\" face=\"Arial, Helvetica, sans-serif\">If you have immediate questions, call us at <font color=\"#FF0000\" size=\"3\">(970) 493-1675</font>&nbsp; or check our <a href=\"http://www.eaglecrossingcolorado.com/concepts.asp\">Current Design Concepts</a> </font></strong></p>\r\n";
MailBody = MailBody + "</body>";
  //End Mail Body

  WA_MailObject = WAUE_SendMail(WA_MailObject,MailAttachments,MailBCC,MailCC,MailTo,MailImportance,MailFrom,MailSubject,MailBody);

  WA_MailObject = null;
}
%>
<%
if ((Request.ServerVariables("Request_Method") == "POST"))     {
  //WA Universal Email object="CDOSYS"
  //Send Loop Once Per Entry

  //Send Mail All Entries
  WA_Universal_Email_1_SendMail();
  if ("thanks.asp?id=" + String(String(Request.Form("tfirstname"))) + ""!="")     {
    Response.Redirect("thanks.asp?id=" + String(String(Request.Form("tfirstname"))) + "");
  }
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="flash-fix.js"></script>
<html><!-- InstanceBegin template="/Templates/eaglecrossing.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Eagle Crossing</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->


<style type="text/css">
<!--
body,td,th {
      color: #FFFFFF;
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
}
body {
      background-color: #000000;
}
.style1 {
      font-size: 14px;
      font-weight: bold;
}
-->
</style><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style1 {      font-size: 14px;
      font-weight: bold;
}
body,td,th {
      font-family: Arial, Helvetica, sans-serif;
      color: #FFFFFF;
}
body {
      background-color: #000000;
}
a:link {
      color: #FFFFFF;
      text-decoration: none;
}
a:visited {
      text-decoration: none;
      color: #CCCCCC;
}
a:hover {
      text-decoration: underline;
      color: #FF0000;
}
a:active {
      text-decoration: none;
}
.style2 {
      font-weight: bold;
      font-size: 12px;
}
-->
</style>
</head>

<body>
<table width="750" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="205"><a href="index.asp"><img src="img/New%20Eagle%20Crossing%20logo%20(2).jpg" width="245" height="245" border="0"></a></td>
        <td width="495"><div id="flashcontent"> </div>
            <script type="text/javascript">
var fo = new FlashObject("banner2.swf", "geek1", "524", "245", "6", "#FFFFFF");
fo.write("flashcontent");
fo.addVariable("variable", "varvalue");
      </script></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2"><!-- InstanceBeginEditable name="EditRegion3" -->
<table width="700" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td><table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><div align="right"><span class="style1">Contact Us </span></div></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2"><form name="form1" method="post" action="">
            <table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="6">Please tell us a bit about you and your needs: </td>
                </tr>
              <tr>
                <td width="138">&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td>First Name: </td>
                <td><input name="tfirstname" type="text" id="tfirstname"></td>
                <td width="112">Last Name: </td>
                <td width="212"><input name="tlastname" type="text" id="tlastname"></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4"><hr></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td>Address:</td>
                <td><input name="taddress" type="text" id="taddress"></td>
                <td>City:</td>
                <td><input name="tcity" type="text" id="tcity"></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4"><hr></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td>State:</td>
                <td><SELECT name=tstate
                              size=1 id="tstate">
                  <option value="No Selection Made"> </option>
                  <option value="AL">Alabama</option>
                  <OPTION
                                value=AK>Alaska</OPTION> <OPTION
                                value=AZ>Arizona</OPTION> <OPTION
                                value=AR>Arkansas</OPTION> <OPTION
                                value=CA>California</OPTION> <OPTION
                                value=CO>Colorado</OPTION> <OPTION
                                value=CT>Connecticut</OPTION> <OPTION
                                value=DE>Delaware</OPTION> <OPTION
                                value=DC>District of Columbia</OPTION> <OPTION
                                value=FL>Florida</OPTION> <OPTION
                                value=GA>Georgia</OPTION> <OPTION
                                value=HI>Hawaii</OPTION> <OPTION
                                value=ID>Idaho</OPTION> <OPTION
                                value=IL>Illinois</OPTION> <OPTION
                                value=IA>Iowa</OPTION> <OPTION
                                value=KS>Kansas</OPTION> <OPTION
                                value=KY>Kentucky</OPTION> <OPTION
                                value=LA>Louisiana</OPTION> <OPTION
                                value=ME>Maine</OPTION> <OPTION
                                value=MD>Maryland</OPTION> <OPTION
                                value=MA>Massachusetts</OPTION> <OPTION
                                value=MI>Michigan</OPTION> <OPTION
                                value=MN>Minnesota</OPTION> <OPTION
                                value=MS>Mississippi</OPTION> <OPTION
                                value=MO>Missouri</OPTION> <OPTION
                                value=MT>Montana</OPTION> <OPTION
                                value=NE>Nebraska</OPTION> <OPTION
                                value=NV>Nevada</OPTION>
                  <option value="NH">New Hampshire</option>
                  <option value="NJ">New Jersey</option>
                  <option value="NM">New Mexico</option>
                  <option value="NY">New York</option>
                  <option value="NC">North Carolina</option>
                  <option value="ND">North Dakota</option>
                  <OPTION value=OH>Ohio</OPTION>
                              <OPTION value=OK>Oklahoma</OPTION> <OPTION
                                value=OR>Oregon</OPTION> <OPTION
                                value=PA>Pennsylvania</OPTION> <OPTION
                                value=RI>Rhode Island</OPTION> <OPTION
                                value=SC>South Carolina</OPTION> <OPTION
                                value=SD>South Dakota</OPTION> <OPTION
                                value=TN>Tennessee</OPTION> <OPTION
                                value=TX>Texas</OPTION> <OPTION
                                value=UT>Utah</OPTION> <OPTION
                                value=VT>Vermont</OPTION> <OPTION
                                value=VA>Virginia</OPTION> <OPTION
                                value=WA>Washington</OPTION> <OPTION
                                value=WV>West Virginia</OPTION> <OPTION
                                value=WI>Wisconsin</OPTION> <OPTION
                                value=MY>Wyoming</OPTION>
                </SELECT>&nbsp;</td>
                <td>Zip</td>
                <td><input name="zip" type="text" id="zip"></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>Email:                  </td>
                <td><input name="temail" type="text" id="temail"></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4"><hr></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">Leasing</div></td>
                <td width="166"><div align="center">Purchasing</div></td>
                <td colspan="2">Square Footage Requirements:</td>
                <td width="3">&nbsp;</td>
                <td width="19">&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center">
                    <input name="rintent" type="radio" value="radiobutton" checked>
                </div></td>
                <td>                    <div align="center">
                  <input name="rintent" type="radio" value="radiobutton">                
                </div></td>
                <td colspan="2"><select name="footage" id="footage">
                  <option value="No Selection Made" selected> </option>
                  <option value="Less than 2000 sq ft.">Less than 2000 sq ft.</option>
                  <option value="2000 sq ft. - 4000 sq ft.">2000 sq ft. - 4000 sq ft.</option>
                  <option value="4000 sq ft. - 6000 sq ft.">4000 sq ft. - 6000 sq ft.</option>
                  <option value="6000 sq ft. - 8000 sq ft.">6000 sq ft. - 8000 sq ft.</option>
                  <option value="8000 sq ft. - 10000 sq ft.">8000 sq ft. - 10000 sq ft.</option>
                  <option value="Greater than 10000 sq ft.">Greater than 10000 sq ft.</option>
                </select></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4"><hr></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="center"></div></td>
                <td>Looking for land to purchase: </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><select name="land" id="land">
                  <option value="Not interested in purchasing land" selected>No thanks</option>
                  <option value="1 Acre">1 Acre</option>
                  <option value="2 Acres">2 Acres</option>
                  <option value="3 Acres">3 Acres</option>
                  <option value="4 Acres">4 Acres</option>
                  <option value="5 Acres">5 Acres</option>
                </select></td>
                <td>&nbsp;</td>
                <td><input type="submit" name="Submit" value="Submit"></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td colspan="5">&nbsp;</td>
              </tr>
            </table>
        </form></td>
      </tr>
      <tr>
        <td width="205">&nbsp;</td>
        <td width="495">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<p>&nbsp;</p>
<!-- InstanceEndEditable --></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2"><div align="center"><span class="style2"><a href="index.asp">Home</a> | <a href="about.asp">About Us</a> | <a href="concepts.asp">Concept Buildings </a> | <a href="current.asp">Site Map </a> | <a href="future.asp">Northern Colorado </a> | <a href="contact.asp">Contact Us</a></span></div></td>
      </tr>
    </table></td>
  </tr>
</table>
</body><!-- InstanceEnd -->
</html>

0
billium99
Asked:
billium99
  • 5
  • 4
1 Solution
 
Irwin SantosComputer Integration SpecialistCommented:
is it in the sentmail queue?

and tell us how you know it IS valid.
0
 
billium99Author Commented:
Thanks

How do I tell if it's in the sentmail queue? 1and1 (my host) doesn't seem to have a location to track traffic from their smtp server.

Is IS valid because I'm using the same account to send mail from other pages successfully. The difference, is, in those cases, I'm always inserting a record. Here I'm trying to only throw the collected form fields into the emails being generated and not submitting a db record at all.
0
 
Irwin SantosComputer Integration SpecialistCommented:
fill in your mailto: ... (to your email account)

does it go out?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
billium99Author Commented:
From the code above:

//To Entries
    WA_MailObject = WAUE_AddRecipient(WA_MailObject,"volk3volk@comcast.net");
    MailTo = gAddRecipient;
  }

I have it being sent directly to my home box already. That's the account where I'm not receiving anything.

Thanks

Bill
0
 
Irwin SantosComputer Integration SpecialistCommented:
Simplify your code by entering working values Before implementing the dynamic content.

...and disable the redirect.

Add this as the 2nd line of code
<% Option Explicit %>
0
 
billium99Author Commented:
OK, so no dynamic content is being used at this point. I removed the redirect, but I could not add <% Option Explicit %> without the page erroring out.

With just the redirect removed, I still did not receive any email.
0
 
Irwin SantosComputer Integration SpecialistCommented:
the purpose of having option explicit is to assist in having any errors displayed.  go into IE, TOOS-INTERNET OPTIONS, and UNCHECK "Show friendly HTTP errors"..

post back the EXACT error here
0
 
HecatonchiresCommented:
option explicit forces you to define (dim) variables explicitly.  you cant have a new variable name just appear.  what it all boils down to is it catches typo's in variable names.
0
 
billium99Author Commented:
Well I started from scratch, and added one element at a time and finally got the whole thing working.

Still not clear why I was having issues before, but it wasn't in any way related to my IE settings - I don't have friendly HTTP errors turned on.

Thanks anyway.

Bill
0
 
Irwin SantosComputer Integration SpecialistCommented:
cool.. thank you... must've missed an item along the way..usually if you build it modular, it would be easier to troubleshoot.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now