Solved

ASPMail with SBS 2003 Standard

Posted on 2006-06-12
31
999 Views
Last Modified: 2011-10-03
We're having trouble with an ASPMail web page that we know works on other servers.  I was hoping you could maybe tell me why it will not work here.  We get an error 500 when this page is referenced by the contact page that contains the forms.  I have attached the code below for actual asp page.  Please let me know if you can help.  Thank you!

<%@ LANGUAGE="VBScript" %>
<% '***************************************************************************
   '* ASP FormMail                                                            *
   '*                                                                         *
   '*                                                                         *
   '***************************************************************************

   '- Customization of these values is required, see documentation. -----------

   referers   = Array("www.mycompany.com", "mycompany.com")
   mailComp   = "ASPMail"
   smtpServer = "mail.mycompany.com"
   fromAddr   = "info@mycompany.com"

   '- End required customization section. -------------------------------------

   Response.Buffer = true
   errorMsgs = Array()

   'Check for form data.

   if Request.ServerVariables("Content_Length") = 0 then
     call AddErrorMsg("No form data submitted.")
   end if

   'Check if referer is allowed.

   if UBound(referers) >= 0 then
     validReferer = false
     referer = GetHost(Request.ServerVariables("HTTP_REFERER"))
     for each host in referers
       if host = referer then
         validReferer = true
       end if
     next
     if not validReferer then
       if referer = "" then
         call AddErrorMsg("No referer.")
       else
         call AddErrorMsg("Invalid referer: '" & referer & "'.")
       end if
     end if
   end if

   'Check for the recipients field.

   if Request.Form("_recipients") = "" then
     call AddErrorMsg("Missing email recipient.")
   end if

   'Check all recipient email addresses.

   recipients = Split(Request.Form("_recipients"), ",")
   for each name in recipients
     name = Trim(name)
     if not IsValidEmailAddress(name) then
       call AddErrorMsg("Invalid email address in recipient list: " & name & ".")
     end if
   next
   recipients = Join(recipients, ",")

   'Get replyTo email address from specified field, if given, and check it.

   name = Trim(Request.Form("_replyToField"))
   if name <> "" then
     replyTo = Request.Form(name)
   else
     replyTo = Request.Form("_replyTo")
   end if
   if replyTo <> "" then
     if not IsValidEmailAddress(replyTo) then
       call AddErrorMsg("Invalid email address in reply-to field: " & replyTo & ".")
     end if
   end if

   'Get subject text.

   subject = Request.Form("_subject")

   'If required fields are specified, check for them.

   if Request.Form("_requiredFields") <> "" then
     required = Split(Request.Form("_requiredFields"), ",")
     for each name in required
       name = Trim(name)
       if Left(name, 1) <> "_" and Request.Form(name) = "" then
         call AddErrorMsg("Missing value for " & name)
       end if
     next
   end if

   'If a field order was given, use it. Otherwise use the order the fields were
   'received in.

   str = ""
   if Request.Form("_fieldOrder") <> "" then
     fieldOrder = Split(Request.Form("_fieldOrder"), ",")
     for each name in fieldOrder
       if str <> "" then
         str = str & ","
       end if
       str = str & Trim(name)
     next
     fieldOrder = Split(str, ",")
   else
     fieldOrder = FormFieldList()
   end if

   'If there were no errors, build the email note and send it.

   if UBound(errorMsgs) < 0 then

     'Build table of form fields and values.

     body = "<table border=""0"" cellpadding=""2"" cellspacing=""0"">" & vbCrLf
     for each name in fieldOrder
       body = body _
            & "<tr valign=""top"">" _
            & "<td><b>" & name & ":</b></td>" _
            & "<td>" & Request.Form(name) & "</td>" _
            & "</tr>" & vbCrLf
     next
     body = body & "</table>" & vbCrLf

     'Add a table for any requested environmental variables.

     if Request.Form("_envars") <> "" then
       body = body _
            & "<p>&nbsp;</p>" & vbCrLf _
            & "<table border=""0"" cellpadding=""2"" cellspacing=""0"">" & vbCrLf
       envars = Split(Request.Form("_envars"), ",")
       for each name in envars
         name = Trim(name)
         body = body _
              & "<tr valign=""top"">" _
              & "<td><b>" & name & ":</b></td>" _
              & "<td>" & Request.ServerVariables(name) & "</td>" _
              & "</tr>" & vbCrLf
       next
       body = body & "</table>" & vbCrLf
     end if

     'Send it.

     str = SendMail()
     if str <> "" then
       AddErrorMsg(str)
     end if

     'Redirect if a URL was given.

     if Request.Form("_redirect") <> "" then
       Response.Redirect(Request.Form("_redirect"))
     end if

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Form Mail</title>
<style type="text/css">

body {
  background-color: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
}

table {
  border: solid 1px #000000;
  border-collapse: collapse;
}

td, th {
  border: solid 1px #000000;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  padding: 2px;
  padding-left: 8px;
  padding-right: 8px;
}

th {
  background-color: #c0c0c0;
}

.error {
  color: #c00000;
}

</style>
</head>
<body>

<% if UBound(errorMsgs) >= 0 then %>
<p class="error">Form could not be processed due to the following errors:</p>
<ul>
<%   for each msg in errorMsgs %>
  <li class="error"><% = msg %></li>
<%   next %>
</ul>
<% else %>
<table cellpadding="0" cellspacing="0">
<tr>
  <th colspan="2" valign="bottom">
  Thank you, the following information has been sent:
  </th>
</tr>
<%   for each name in fieldOrder %>
<tr valign="top">
  <td><b><% = name %></b></td>
  <td><% = Request.Form(name) %></td>
</tr>
<%   next %>
</table>
<% end if %>

</body>
</html>

<% '---------------------------------------------------------------------------
   ' Subroutines and functions.
   '---------------------------------------------------------------------------

   sub AddErrorMsg(msg)

     dim n

    'Add an error message to the list.

     n = UBound(errorMsgs)
     Redim Preserve errorMsgs(n + 1)
     errorMsgs(n + 1) = msg

   end sub

   function GetHost(url)

     dim i, s

     GetHost = ""

     'Strip down to host or IP address and port number, if any.

     if Left(url, 7) = "http://" then
       s = Mid(url, 8)
     elseif Left(url, 8) = "https://" then
       s = Mid(url, 9)
     end if
     i = InStr(s, "/")
     if i > 1 then
       s = Mid(s, 1, i - 1)
     end if

     getHost = s

   end function

   'Define the global list of valid TLDs.

   dim validTlds

   function IsValidEmailAddress(emailAddr)

     dim i, localPart, domain, charCode, subdomain, subdomains, tld

     'Check for valid syntax in an email address.

     IsValidEmailAddress = true

     'Parse out the local part and the domain.

     i = InStrRev(emailAddr, "@")
     if i <= 1 then
       IsValidEmailAddress = false
       exit function
     end if
     localPart = Left(emailAddr, i - 1)
     domain = Mid(emailAddr, i + 1)
     if Len(localPart) < 1 or Len(domain) < 3 then
       IsValidEmailAddress = false
       exit function
     end if

     'Check for invalid characters in the local part.

     for i = 1 to Len(localPart)
       charCode = Asc(Mid(localPart, i, 1))
       if charCode < 32 or charCode >= 127 then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Check for invalid characters in the domain.

     domain = LCase(domain)
     for i = 1 to Len(domain)
       charCode = Asc(Mid(domain, i, 1))
       if not ((charCode >= 97 and charCode <= 122) or (charCode >= 48 and charCode <= 57) or charCode = 45 or charCode = 46) then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Check each subdomain.

     subdomains = Split(domain, ".")
     for each subdomain in subdomains
       if Len(subdomain) < 1 then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Last subdomain should be a TDL.

     tld = subdomains(UBound(subdomains))
     if not IsArray(validTlds) then
       call SetValidTlds()
     end if
     for i = LBound(validTlds) to UBound(validTlds)
       if tld = validTlds(i) then
         exit function
       end if
     next
     IsValidEmailAddress = false

   end function

   sub setValidTlds()

     'Load the global list of valid TLDs.

     validTlds = Array("aero", "biz", "com", "coop", "edu", "gov", "info", "int", "mil", "museum", "name", "net", "org", "pro", _
       "ac", "ad", "ae", "af", "ag", "ai", "al", "am", "an", "ao", "aq", "ar", "as", "at", "au", "aw", "az", _
       "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", "br", "bs", "bt", "bv", "bw", "by", "bz", _
       "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cx", "cy", "cz", _
       "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", _
       "fi", "fj", "fk", "fm", "fo", "fr", _
       "ga", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", _
       "hk", "hm", "hn", "hr", "ht", "hu", _
       "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", _
       "je", "jm", "jo", "jp", _
       "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", _
       "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", _
       "ma", "mc", "md", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw ", "mx", "my", "mz", _
       "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", _
       "om", _
       "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", _
       "qa", _
       "re", "ro", "ru", "rw", _
       "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "st", "sv", "sy", "sz", _
       "tc", "td", "tf", "tg", "th", "tj", "tk", "tm", "tn", "to", "tp", "tr", "tt", "tv", "tw", "tz", _
       "ua", "ug", "uk", "um", "us", "uy", "uz", _
       "va", "vc", "ve", "vg", "vi", "vn", "vu", _
       "wf", "ws", _
       "ye", "yt", "yu", _
       "za", "zm", "zw")

   end sub

   function FormFieldList()

     dim str, i, name

     'Build an array of form field names ordered as they were received.

     str = ""
     for i = 1 to Request.Form.Count
       for each name in Request.Form
         if Left(name, 1) <> "_" and Request.Form(name) is Request.Form(i) then
           if str <> "" then
             str = str & ","
           end if
           str = str & name
           exit for
         end if
       next
     next
     FormFieldList = Split(str, ",")

   end function

   function SendMail()

     dim mailObj, cdoMessage, cdoConfig
     dim addrList

     'Send email based on mail component. Uses global variables for parameters
     'because there are so many.

     SendMail = ""

     'Send email (CDONTS version). Note: CDONTS has no error checking.

     if mailComp = "CDONTS" then
       set mailObj = Server.CreateObject("CDONTS.NewMail")
       mailObj.BodyFormat = 0
       mailObj.MailFormat = 0
       mailObj.From = fromAddr
       mailObj.Value("Reply-To") = replyTo
       mailObj.To = recipients
       mailObj.Subject = subject
       mailObj.Body = body
       mailObj.Send
       set mailObj = Nothing
       exit function
     end if

     'Send email (CDOSYS version).

     if mailComp = "CDOSYS" then
       set cdoMessage = Server.CreateObject("CDO.Message")
       set cdoConfig = Server.CreateObject("CDO.Configuration")
       cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
       cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
       cdoConfig.Fields.Update
       set cdoMessage.Configuration = cdoConfig
       cdoMessage.From =  fromAddr
       cdoMessage.ReplyTo = replyTo
       cdoMessage.To = recipients
       cdoMessage.Subject = subject
       cdoMessage.HtmlBody = body
       on error resume next
       cdoMessage.Send
       if Err.Number <> 0 then
         SendMail = "Email send failed: " & Err.Description & "."
       end if
       set cdoMessage = Nothing
       set cdoConfig = Nothing
       exit function
     end if

     'Send email (JMail version).

     if mailComp = "JMail" then
       set mailObj = Server.CreateObject("JMail.SMTPMail")
       mailObj.Silent = true
       mailObj.ServerAddress = smtpServer
       mailObj.Sender = fromAddr
       mailObj.ReplyTo = replyTo
       mailObj.Subject = subject
       addrList = Split(recipients, ",")
       for each addr in addrList
         mailObj.AddRecipient Trim(addr)
       next
       mailObj.ContentType = "text/html"
       mailObj.Body = body
       if not mailObj.Execute then
         SendMail = "Email send failed: " & mailObj.ErrorMessage & "."
       end if
       exit function
     end if

     'Send email (ASPMail version).

     if mailComp = "ASPMail" then
       set mailObj = Server.CreateObject("SMTPsvg.Mailer")
       mailObj.RemoteHost  = smtpServer
       mailObj.FromAddress = fromAddr
       mailObj.ReplyTo = replyTo
       for each addr in Split(recipients, ",")
         mailObj.AddRecipient "", Trim(addr)
       next
       mailObj.Subject = subject
       mailObj.ContentType = "text/html"
       mailObj.BodyText = body
       if not mailObj.SendMail then
         SendMail = "Email send failed: " & mailObj.Response & "."
       end if
       exit function
    end if

   end function %>
0
Comment
Question by:CompTechNS
  • 16
  • 9
  • 6
31 Comments
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
Comment Utility
Take a look at this question and see if it gives you the proper answer:  http:Q_21404125.html

Otherwise, please post back the specific 500 error you are receiving... you may need to turn off "friendly error messages" in order to see the real problem.

Jeff
TechSoEasy
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
Just glancing through the code there is nothing outstanding wrong with it, but in general the problem would not be the asp files themselves but in the configuration or the connection string to databases. Also please note posting code that is not your own, but from a commercial program may be in violation of copyright, so please be very careful.

Which version of aspmail are you using?
You did register the dll file as indicated here if you are using version 4:
http://www.serverobjects.com/comp/Aspmail4.htm
Link was in one of the posts in TechSoEasy's link.
Have you changed any strings within the asp files themselves?
Excert from the page linked:
500 series errors are errors that the SMTP server generates. This error means that the message recipients given are either not given (you didn't use AddRecipient, AddCC or AddBCC) OR they are not valid recipients for this SMTP server. This is often associated with the "no relay" issued covered above. The SMTP server rejects the given recipients and then issues this error. This typically happens when you have IgnoreInvalidRecipients set to true. You can verify that the SMTP server is ignoring your recipients due to the "no relay" issue or for any other reason by using the SMTPLog property to generate a log and then look at the rejection errors in the log file.
You might want to check your event logs for any errors, and you should probably turn the smtp logging to maximum to capture the problem in depth, please post all errors in the event log here.

I would agree with TechSoEasy, posting the exact error that you got would be very helpful,

David
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Here's the non-friendly version of the error message:

Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/asp/formmail.asp, line 478
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

In response to your post - I'm not sure that I'm getting anything from that.  We are using Exchange 2003 withing SBS for the mycompany.com email...  I an not aware of IMAIL being on the system.  Is there a setting in Exchange that I am missing dealing with the relay?  Also, does my last post point to a coding error or is it just one of those errors you get when something on the server isn't right?

Thank  you!
Chris
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
David,

My lack of knowledge about web programming at this level is about to show (I am just Sys Admin dealing with the web designer telling me this works on other servers).  I do not know if ASPMail is actually installed.  I assumed that since ASP is installed (I believe) as part of SBS 2003 that this code was simply using what was there...  I did not know that ASPMail was possibly separate.

Do I need to install ASPMail 4?

Thank you!
Chris
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
With what is provided I'm going to do this in two posts.
With regards installing aspmail you need to register the dll as calls will be made to the files, the details are in the link previously supplied or http://www.aspemail.com/manual_01.html

0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
The error message revolves around the very last line, the end function command, so if the dll was not previously registered this could be the problem, it could als be a a more serious problem with the code, but once you have run through the procedures in the previous post we can delve deeper into the code.


David
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
David,

I installed ASPEmail 5.0 per your post.  The installer led me to a page explaining how to modify (or add) code to use ASPEmail.  I followed the directions, even removing some unneeded verifications of the To: and From: addresses (they are set by us, not the form)...  Still get a stop error, same as before on the last line.

I can repost modified code if you'd like.

Thank you!
Chris
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
Sorry for not getting back sooner.

It looks like it is either expecting something in that last function.

Could you post the code between the last  <% ... %>
Roughly the last 250 lines of code.

Have you made any changes to the base SBS install?
It may just be a routing issue with the server?
Did you use the sbs server or your ISP's SMTP server as the Remotehost?

David


0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
The function that is giving us trouble is meant to confirm that the email address entered by the web page viewer is a valid email address.  Here goes:

<% '---------------------------------------------------------------------------
   ' Subroutines and functions.
   '---------------------------------------------------------------------------

   sub AddErrorMsg(msg)

     dim n

    'Add an error message to the list.

     n = UBound(errorMsgs)
     Redim Preserve errorMsgs(n + 1)
     errorMsgs(n + 1) = msg

   end sub

   function GetHost(url)

     dim i, s

     GetHost = ""

     'Strip down to host or IP address and port number, if any.

     if Left(url, 7) = "http://" then
       s = Mid(url, 8)
     elseif Left(url, 8) = "https://" then
       s = Mid(url, 9)
     end if
     i = InStr(s, "/")
     if i > 1 then
       s = Mid(s, 1, i - 1)
     end if

     getHost = s

   end function

   'Define the global list of valid TLDs.

   dim validTlds

   function IsValidEmailAddress(emailAddr)

     dim i, localPart, domain, charCode, subdomain, subdomains, tld

     'Check for valid syntax in an email address.

     IsValidEmailAddress = true

     'Parse out the local part and the domain.

     i = InStrRev(emailAddr, "@")
     if i <= 1 then
       IsValidEmailAddress = false
       exit function
     end if
     localPart = Left(emailAddr, i - 1)
     domain = Mid(emailAddr, i + 1)
     if Len(localPart) < 1 or Len(domain) < 3 then
       IsValidEmailAddress = false
       exit function
     end if

     'Check for invalid characters in the local part.

     for i = 1 to Len(localPart)
       charCode = Asc(Mid(localPart, i, 1))
       if charCode < 32 or charCode >= 127 then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Check for invalid characters in the domain.

     domain = LCase(domain)
     for i = 1 to Len(domain)
       charCode = Asc(Mid(domain, i, 1))
       if not ((charCode >= 97 and charCode <= 122) or (charCode >= 48 and charCode <= 57) or charCode = 45 or charCode = 46) then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Check each subdomain.

     subdomains = Split(domain, ".")
     for each subdomain in subdomains
       if Len(subdomain) < 1 then
         IsValidEmailAddress = false
         exit function
       end if
     next

     'Last subdomain should be a TDL.

     tld = subdomains(UBound(subdomains))
     if not IsArray(validTlds) then
       call SetValidTlds()
     end if
     for i = LBound(validTlds) to UBound(validTlds)
       if tld = validTlds(i) then
         exit function
       end if
     next
     IsValidEmailAddress = false

   end function

   sub setValidTlds()

     'Load the global list of valid TLDs.

     validTlds = Array("aero", "biz", "com", "coop", "edu", "gov", "info", "int", "mil", "museum", "name", "net", "org", "pro", _
       "ac", "ad", "ae", "af", "ag", "ai", "al", "am", "an", "ao", "aq", "ar", "as", "at", "au", "aw", "az", _
       "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", "br", "bs", "bt", "bv", "bw", "by", "bz", _
       "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cx", "cy", "cz", _
       "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", _
       "fi", "fj", "fk", "fm", "fo", "fr", _
       "ga", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", _
       "hk", "hm", "hn", "hr", "ht", "hu", _
       "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", _
       "je", "jm", "jo", "jp", _
       "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", _
       "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", _
       "ma", "mc", "md", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw ", "mx", "my", "mz", _
       "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", _
       "om", _
       "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", _
       "qa", _
       "re", "ro", "ru", "rw", _
       "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "st", "sv", "sy", "sz", _
       "tc", "td", "tf", "tg", "th", "tj", "tk", "tm", "tn", "to", "tp", "tr", "tt", "tv", "tw", "tz", _
       "ua", "ug", "uk", "um", "us", "uy", "uz", _
       "va", "vc", "ve", "vg", "vi", "vn", "vu", _
       "wf", "ws", _
       "ye", "yt", "yu", _
       "za", "zm", "zw")

   end sub

   function FormFieldList()

     dim str, i, name

     'Build an array of form field names ordered as they were received.

     str = ""
     for i = 1 to Request.Form.Count
       for each name in Request.Form
         if Left(name, 1) <> "_" and Request.Form(name) is Request.Form(i) then
           if str <> "" then
             str = str & ","
           end if
           str = str & name
           exit for
         end if
       next
     next
     FormFieldList = Split(str, ",")

   end function
%>
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
As for the server itself:

We haven't made any changes persay to the SBS install except to setup comanyweb, Exchange, IIS (just modified host header values to allow for internet and intranet hosting).

We use Exchange for all email at mycompany.com and it is functioning as the SMTP server.

Sorry I can't give you more.  I know Windows Server but SBS is a little new to me...

Thank you!
Chris
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
Comment Utility
actually that would be your problem... you don't manually modify host header values on an SBS.  All of that is done with the Configure Email and Internet Connection Wizard.  Have you run that?  If so, were there any errors?

If not, you should run it.  Please see http://sbsurl.com/ceicw for an overview.

Jeff
TechSoEasy
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

Yes, we've run CEICW multiple times.  We have actually posted multiple threads now that you have helped with, including one where you advised me that it would be OK to modify the host header values to make mycompany.com the default web site at the external IP instead of RWW...

Just want to make sure we're on the same page, when I say "Host Header Values" I'm referring to the identifiers under the advanced option for the web site IP address.

There were no errors in the setup of the system.  The only other problems we are experiencing are that Monitoring will not re-install after being removed because it was not working (it errors out saying it's already on the system, but it won't let me set it up), and Backup does not appear in Server Management (I get a "Page can not be found" error) but it does work fine.

Thanks!
Chris
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
Here is a link to hosting a Business Card Website on SBS
http://download.microsoft.com/download/8/c/5/8c5887ea-59d4-416a-9966-cfa047afd517/BusCardSBS2003.doc

It does not mention using host headers.
I wouldn't use host headers for the default website, personally, I would leave it alone, create a new site and set it up with host headers

If you have used the installer above to set aspmail you should be able to go to
http://internalIP/aspemail/simple_index.htm
Where InternalIP is your lan ip of your server
And select the first option, fill in the form
Please post back any errors

David
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
SAme asp file giving you the error?

David
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 8

Accepted Solution

by:
dhoustonie earned 350 total points
Comment Utility
Apologies, I have made a mistake
It is not aspemail that you are using it is
http://www.brainjar.com/common/viewsource.asp?source=/asp/formmail/formmail.asp
 A different script entirely. So sorry about that.

Further information on tailoring this form is available at:
http://www.brainjar.com/asp/formmail/default.asp
http://www.formmail.us/
http://www.sortedsites.com/software/formmail.asp

SortedSites does state that it released a bugged version of the script.

Run through the Brainjar details to work with the script.
Smtp server should be 127.0.0.1 as far as I know, I'll run through it tomorrow on my own server.



Please note that the copyright information has been removed from the script above
0
 
LVL 74

Assisted Solution

by:Jeffrey Kane - TechSoEasy
Jeffrey Kane - TechSoEasy earned 150 total points
Comment Utility
I think you have confused the issue somehow...

RWW is NOT the default page to begin with.  The default page is a page that says the following:

Welcome to Windows Small Business Server 2003
 To get started, click a link.


  My Company's Internal Web Site
 Collaborate and share documents on your company's internal Web site.
   
  Network Configuration Wizard
 Join a client computer to the Windows Small Business Server network.
   
  Remote Web Workplace
 Connect to the Windows Small Business Server network over the Internet.
   
  Information and Answers
 Learn more about Windows Small Business Server.
   
 
While this has a link to RWW, it's not RWW.

If you want mycompany.com to go to your server, then you just need a host record pointing to the server's IP address wherever mycompany.com is registered.  No need for any host header... it'll take you to the default web page.  If you want different content there, you need to either change the directory that the default page is pointing to (C:\Inetpub\wwwroot) or you need to put your content in that directory.

Then, users can still access Remote Web Workplace by going to https://mycompany.com/remote or they can access Outlook Web Access via https://mycompany.com/exchange.

That initial "Welcome to Windows Small Business Server 2003" page would just diasppear.  There is really no need for it anyhow, and if you weren't trying to host a public site on your server, I'd suggest that you don't open port 80 to begin with.

That leaves us with your Intranet... or http://companyweb.  This site DOES have a host header because internally it's only accessed via http://companyweb.  Externally, assuming you've pointed mycompany.com to the server, it would be accessed via https://mycompany.com:444.  But generally this isn't necessary since it is linked from within the RWW main menu and would be accessed via there (as is Outlook Web Access as well).

So, I don't know what host header you put on the DEFAULT site, but you should remove it.  Then rerun the CEICW and please then post
C:\Program Files\Microsoft Windows Small Business Server\Networking\ICW\IcwdetailsXX.htm (where XX is the latest incremental number) to this thread so we can review the results.  Feel free to alter your actual domain or IP address.

Jeff
TechSoEasy
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff - I think you misunderstood me.  When I said that the default page was RWW that's only because when I saw the link I assumed it was all part of the same system...

I am out of town right now ad will be until the end of the week.  I will look through everything that has been posted as soon as I am able and get back to all suggestions.  Please be patient with me.

Thank you!
Chris
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
Comment Utility
I don't want to argue here... but really, it was you that misunderstood...  I heard what you said, but what you said wasn't correct because it was based on your misunderstanding of SBS and it's components.  So... hopefully now, we really are both on the same page!  :-)

Jeff
TechSoEasy
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

We had posted a thread previously inquiring as to how you recommend setting up IIS to make mycompany.com the default web site on port 80.  I assumed, as is with IIS, that this was done via host header values and missed the part of your response where you told me to just put my web site in the default web site...  I get it now.

Here's we had done - We had started off with a dynamic IP and mycompany.com was hosted outside so we setup mycompany.homeip.net to point to the server for access to RWW through the default web site.  We then added a 4th web site to IIS (mycompany.com) with the primary goal being the ability to use Exchange for email.  We then added host header values to the default web site to keep it on mycompany.homeip.net but not make the actual default on port 80...

So - I have now removed the mycompany.com web site from IIS.  I have changed the folder for the default web site to be the mycompany.com folder.  I have removed all host header values from the default web site.  The only problem I seem to have now is that companyweb is not accessible via the link in RWW (page not found).  But - Backup now works in Server Management!

I will post the file you requested in a second.

Thank you!
Chris
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

Here is the file you requested:

SUMMARY OF SETTINGS FOR CONFIGURE E-MAIL AND INTERNET CONNECTION WIZARD

This file contains detailed information about the configurations specified in the Configure E-mail and Internet Connection Wizard. The configurations specified in the Configure E-mail and Internet Connection Wizard determine the settings for your network, firewall, secure Web site, and e-mail.

NETWORKING CONFIGURATION SUMMARY

After the wizard completes, the following network connection settings will be configured:
Connection type: broadband connection using  a local router device with an IP address
After the wizard completes, the following broadband connection settings will be configured:
Router connection information:
      Local IP address of the router: 10.0.10.9
      Preferred DNS server: *masked
      Alternate DNS server: *masked
Connection information for the network adapter used to connect to your local network:
      Local network connection name: Server Local Area Connection
      Local network connection IP address: 10.0.0.1
      Local network connection subnet mask: 255.255.255.0
      The Default Gateway for the network adapter used to access the local network is cleared so that network traffic is routed correctly.
Routing and Remote Access will be configured as follows:
      Enable the service as a router for the local area network to route network traffic to the Internet.
      Enable IP routing to route network traffic to the Internet.
      Enable broadcast name resolution.
      Enable Basic Firewall on the demand-dial interface.
      Disable the option to automatically assign IP addresses by using the DHCP allocator because DHCP is provided by your server’s DHCP server.
      Disable the option to resolve IP address for clients using DNS because DHCP is provided by your server’s DHCP server.
Disable File and Print Sharing for Microsoft Networks for the network adapter or modem used to connect to your ISP. This reduces the chance of a malicious attack by limiting the ability to browse the network and to connect to file shares and network printers.
Unbind remote procedure call (RPC) from the network adapter or modem used to connect to your ISP. This reduces the chance of a malicious attack by limiting the ability to connect to this service.
Bind the DHCP Server service to the IP address of the local network adapter so that your server’s DHCP server does not provide DHCP addresses to computers on the Internet.
Configure the DHCP scope to assign IP addresses to client computers using the following scope options:
      Set the router option (003) to 10.0.0.1 to define the default gateway used by client computers.
      Set the DNS server option (006) to 10.0.0.1 to provide client computers with name resolution services for the local network.
      Set the DNS domain name option (015) to mycompany.local.
      Set the Windows Internet Name Service (WINS) server option (044) to 10.0.0.1.
      Set the WINS node type option (046) to h-node.
Set forwarders to *masked and *masked so that name resolution requests intended for the Internet are forwarded to the DNS servers at your ISP.
Set the DNS Server service to listen to the IP address of the local network adapter to ensure that the DNS server is not responding to DNS request from the Internet.
Enable dynamic and secured updates to allow client computers to update DNS, but not allow DHCP to update DNS. This allows client computers to update the DNS table when they are turned on.
Modify the binding order so that the local network adapter has the highest priority to route network traffic to the Internet.
Set Internet Explorer to never dial a connection, to not use proxy settings, and set the home page to the address of the computer running Windows Small Business Server.

FIREWALL CONFIGURATION SUMMARY

After the wizard completes, the following firewall settings will be configured:

Routing and Remote Access will be configured as follows:

            Add the loopback adapter IP address of 127.0.0.1 to support the http://localhost for IIS.

Internet Information Services (IIS) will be configured as follows:

      To only listen on the local network adapter. This allows Routing and Remote Access to monitor incoming Web requests from the Internet.

      Set the maximum number of incoming Web request connections allowed to the default Web site to 500. This improves system availability and reliability by mitigating denial-of-service attacks against your Web site.



SECURE WEB SITE CONFIGURATION SUMMARY

After the wizard completes, the following secure Web site settings will be configured:
Secure Sockets Layer (SSL) will be configured as follows:
Do not change current Web server certificate

E-MAIL CONFIGURATION SUMMARY

After the wizard completes, the following e-mail settings will be configured:
Exchange will be configured as follows:
Email: Do not change Exchange configuration for Internet e-mail.
      Keep the existing Internet e-mail configuration.

After the wizard completes, the icwlog.txt in C:\Program Files\Microsoft Windows Small Business Server\Support is updated.
After the wizard completes, the wizard script file config.vbs is created in C:\Program Files\Microsoft Windows Small Business Server\Networking\Icw.
NOTE: Each time the wizard runs, a new config.vbs file is automatically generated to preserve the previous settings. For example config.vbs, config1.vbs, config2.vbs, and so on.
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
David,

I'll have to admit, you've confused me slightly...  Will the code I have work with ASPEmail, should I have installed something else, or did I not need to install anything in the first place?

What would you recommend at this point - Do I start over or can I make this work with our setup?

Thank you!
Chris
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
Comment Utility
Well, I wonder if we were a bit to confusing on the last question (http:Q_21828371.html) because the changes didn't really get made as recommended. I really think that resolving your networking configuration is paramount to being able to actually answer your original question in this thread.  Otherwise, we won't have a stable platform in which to actually know what's causing the ASPEmail issue to begin with... so it's important to drop any work on that side of things until you've resolved this side.

Spcifically, it looks as though when you changed the IP Addresses per the answer provided, you changed the NIC that was configured as your Internal Network Interface instead of the External one.  If you look at your IPCONFIG /ALL from that question, 10.0.0.2 was the server's internal IP address and it was propagating just fine to your workstations.  Yet that's the one that you changed to an 10.0.10.x IP.  

I did include a note in the last question about making sure that your binding order was correct... so if even if you did change it as above, if you checked the binding order you would probably have found that it was incorrect and would need to have modified the order so that the Internal NIC was first and the WAN NIC second.  Then you'll be alright with this but ONLY if run the "Change Server IP Address Wizard" to make sure that all DNS and DHCP entries have it now set as 10.0.0.1 instead of the original 10.0.0.2.

Then rerun the CEICW ONCE MORE because the companyweb link doesn't work in RWW which is caused by skipping over the Firewall Configuration in the CEICW and not selecting the components to be available.  This is what configures the RWW main menu.

I'm not entirely sure what you mean by "Do I start over"... do you mean a complete reinstall?  You shouldn't need to do that... you just need to make sure that your network configuration is correct and working properly.  Then you should have no problem with the ASPEmail issue.

So... when you've completed the above, please post the most current IPCONFIG /ALL from your server and a sample workstation.

Thanks!

Jeff
TechSoEasy


0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

The initial setup was 10.0.0.1 for the external NIC and 10.0.0.2 for the internal NIC.  When we made the changes per your last post, I simply changed both IP's - 10.0.0.1 to 10.0.10.1 and 10.0.0.2 to 10.0.0.1

Binding order is correct, exactly how your last post stated.
"Change You Server IP Address Wizard" has been run successfully (10.0.0.1 was shown).
CEICW has been rerun with reconfiguring the firewall. - Companyweb now works from RWW!

When I asked about "Starting Over" I was referring to the formmal, as to whether or not I need to start from scratch with the code or if what I have can be salvaged...  I was just confused as to where David was directing me.

Here's the server's IPConfig /All:

Windows IP Configuration

   Host Name . . . . . . . . . . . . : psserver
   Primary Dns Suffix  . . . . . . . : mycompany.local
   Node Type . . . . . . . . . . . . : Unknown
   IP Routing Enabled. . . . . . . . : Yes
   WINS Proxy Enabled. . . . . . . . : Yes
   DNS Suffix Search List. . . . . . : mycompany.local

Ethernet adapter Server Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Dual Port Network Connection #2
   Physical Address. . . . . . . . . : 00-04-23-BB-DC-01
   DHCP Enabled. . . . . . . . . . . : No
   IP Address. . . . . . . . . . . . : 10.0.0.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
   DNS Servers . . . . . . . . . . . : 10.0.0.1
   Primary WINS Server . . . . . . . : 10.0.0.1

Ethernet adapter Network Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Dual Port Network Connection
   Physical Address. . . . . . . . . : 00-04-23-BB-DC-00
   DHCP Enabled. . . . . . . . . . . : No
   IP Address. . . . . . . . . . . . : 10.0.10.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.10.9
   DNS Servers . . . . . . . . . . . : 10.0.0.1
   NetBIOS over Tcpip. . . . . . . . : Disabled

Here's the IPConfig /All from a workstation:

Windows IP Configuration

        Host Name . . . . . . . . . . . . : ps101
        Primary Dns Suffix  . . . . . . . : mycompany.local
        Node Type . . . . . . . . . . . . : Hybrid
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : mycompany.local
                                            mycompany.local

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : mycompany.local
        Description . . . . . . . . . . . : Realtek RTL8169/8110 Family Gigabit Ethernet NIC
        Physical Address. . . . . . . . . : 00-0E-2E-39-FC-7E
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 10.0.0.65
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 10.0.0.1
        DHCP Server . . . . . . . . . . . : 10.0.0.1
        DNS Servers . . . . . . . . . . . : 10.0.0.1
        Primary WINS Server . . . . . . . : 10.0.0.1
        Lease Obtained. . . . . . . . . . : Monday, June 26, 2006 9:52:37 AM
        Lease Expires . . . . . . . . . . : Tuesday, July 04, 2006 9:52:37 AM

Thank you!
Chris
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
Sorry for the delay.
Yes, we'll need to start over again with regards the asp file, you will need to uninstall aspemail, the instructions are in the links provided.
Again apologies.
The new links provide details on editing the original asp file to suit the network.
Just one point, the file that was originally shown, does not have the copyright information that is part of this file.
If you received the file this way from the developer, he is liable, and in breach of any licensing agreement. Be wary of anyone that does this.

David
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
David,

I recoded the formmail (including the copyright) according to Brainjar and uninstalled ASPEmail.

I followed their directions to set it up - It works!  The key here was to use CDOSYS as the type and 127.0.0.1 as the SMTP server.

Thank you!
Chris
0
 
LVL 8

Expert Comment

by:dhoustonie
Comment Utility
Again sorry about the confusion, glad you got it sorted, but I would continue with Jeff and sort out all issues completely.

David
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Jeff,

It seems like the last problem we have is with Monitoring & Reporting.  Back when we were attempting to resolve the issues with Backup & Monitoring and Reporting within Server Management we uninstalled and reinstalled Monitoring and Reporting...

As I mentioned earlier, rearranging IIS fixed Backup.  However, ever since the reinstall we have not been able to successfully setup Monitoring and Reporting.  Every time we run the wizard, all 4 steps fail with the message "An error occured while running the wizard."

Any thoughts (I can start a new thread to address this separately if you think it's appropriate).

Thank you!
Chris
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
Here's a thought -

How about if I close this thread, giving 350 points to dhoustonie since he actually solved the problem with the code and 150 points to Jeff since I'm pretty sure the solution would not have worked without fixing IIS?  I'll then start a new thread addressing the Monitoring & Reporting issue worth another 500 points that hopefully, Jeff, you can help me with.

Please let me know, I don't want to offend anyone.

Thank you!
Chris
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
Comment Utility
That's no problem, and a good idea.

Jeff
TechSoEasy
0
 
LVL 1

Author Comment

by:CompTechNS
Comment Utility
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of problems and solutions are available on the net for the error message "Source server does not meet minimum requirements for migration" while performing a migration from Small Business Server 2003 to SBS 2008. This error pops up just before …
Because virtualization becomes more and more common, and, with Microsoft Hyper-V included in Windows Server at no additional costs, and, most server hardware nowadays is more than capable of running a physical Small Business Server (SBS) 2008 or 201…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

16 Experts available now in Live!

Get 1:1 Help Now