?
Solved

ASP Dundas Mailer

Posted on 2006-11-29
11
Medium Priority
?
1,926 Views
Last Modified: 2012-08-14
I have a web page xp_contactus.asp there is an email address that no longer is valid therefore when someone goes to request information it sends a reply back to them lettting them know the mail box is no longer available.  I tried to make it so my email address or a currently email address is there instead once I do that I get an error message and it never gets sent out.  Below is my ASP Page:

<!--#include file="inc_header.asp"-->
<%
Dim objEmail 'stores mailer control instance
Dim Index 'counter variable
dim sendersName, sendersEmail, EmailSubject, message

'Server.ScriptTimeout = 240

' enter your newsletter editors name
sendersName      = request("name")

' enter the email address for the emails
' to appear to come from
sendersEmail=request("email")
if sendersEmail="" then
      sendersEmail = "techsupport1@cormarkinc.com"
end if

EmailSubject = "Website Cormark - Contact."

' the following line will take
' whatever text you enter on the form
message =       "Name: "                         & sendersname & vbcrlf &_
                  "Company: "                   & request("company") & vbcrlf &_
                  "Title/Department: "       & request("title") & vbcrlf &_
                  "Address: "                   & request("address") & vbcrlf &_
                  "City: "                         & request("city") & vbcrlf &_
                  "State: "                         & request("state") & vbcrlf &_
                  "Zip Code: "                   & request("zip") & vbcrlf &_
                  "Country: "                   & request("country") & vbcrlf &_
                  "E-mail: "                         & request("email") & vbcrlf &_
                  "Phone: "                         & request("phone") & vbcrlf &_
                  "Fax: "                         & request("fax") & vbcrlf & vbcrlf &_
                  "Message"                         & vbcrlf & request("message")


'functions will throw an exception if not successful so On Error Resume Next is used for inline error trapping
'On Error Resume Next

Set objEmail = Server.CreateObject("Dundas.Mailer") 'Mailer object
'objEmail.SMTPRelayServers.Add "206.135.21.252"
'objEmail.TimeOutConnect = 180
'objEmail.TimeOutSend      = 120
'objEmail.TimeOutReceive      = 120


'add an Address object to the TOs collection (this specifies the destination address)
objEmail.TOs.Add "cormark@livrodigital.com.br" THIS IS WHERE I MAKE THE CHANGE AND ENTER THE CORRECT EMAIL ADDRESS

'specify the message subject
objEmail.Subject = EmailSubject

'specify the sender of the message
objEmail.FromName            = sendersName
objEmail.FromAddress      = sendersEmail

'specify an SMTP server. Doing this increases the speed and reliability of the mail operation
'objEmail.SMTPRelayServers.Add "somesmtpserver.com"

'set the message body
objEmail.Body = message

'now send the email
objEmail.SendMail









%>

      <table width="751" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#000000"><table width="751" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td width="236"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="236" height="343" hspace="0" vspace="0"><param name="movie" value="../swf/contactus.swf"><param name=quality value=high><embed src="../swf/contactus.swf" width="236" height="343" hspace="0" vspace="0" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed></object></td>
                <td height="63" bgcolor="#F6F5F3" valign="top">
<table width="420" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td colspan="3" height="100"></td>
                    </tr>
                    <tr>
                      <td width="60" class="portfolio">&nbsp;</td>
                      <td class="portfolio"><p>We will be providing you with any information required within the shortest time possible.</p><p>Thank you for contacting Cormark.</p></td>
                      <td width="22">&nbsp;</td>
                    </tr>
                    <tr>
                      <td colspan="3" height="22"></td>
                    </tr>
                  </table>
</td>
              </tr>
                    </table>

                      </td>
              </tr>
            </table>
              </td>
        </tr>
      </table>

      <table width="751" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom"><img src="icon/px.gif" width="247" height="1"><img src="icon/txt_address1a.gif" width="410" height="24"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
Set objEmail = Nothing 'release resources
%>




<%
function titleCase(strWord)

if not strWord = "" then
      titleCase=ucase(left(strWord,1)) & lcase(right(strWord,len(strWord)-1))
else
      titleCase=""
end if            

end function

function unhtml(strText)

strText=replace(strText,"<P>", vbcrlf & vbcrlf,1,-1,1)
strText=replace(strText,"<BR>", vbcrlf,1,-1,1)
strText=replace(strText,"<B>", "",1,-1,1)
strText=replace(strText,"<STRONG>", ":: ",1,-1,1)
strText=replace(strText,"<I>", "",1,-1,1)
strText=replace(strText,"</P>", "",1,-1,1)
strText=replace(strText,"</B>", "",1,-1,1)
strText=replace(strText,"</I>", "",1,-1,1)
strText=replace(strText,"</STRONG>", "",1,-1,1)
strText=replace(strText,"<a href=""", "",1,-1,1)
strText=replace(strText,""">", vbcrlf,1,-1,1)
strText=replace(strText,"</A>","",1,-1,1)
unhtml=strText

end function


function friendlyDate(dtmDate)

lastDigit=right(day(dtmDate),1)
dayNumber=day(dtmDate)

if lastDigit="1" and not dayNumber="11" then
      dayNumber=dayNumber & "st"
elseif lastDigit = "2" and not dayNumber= "12" then
      dayNumber=dayNumber & "nd"
elseif lastDigit = "3" and not dayNumber = "13" then
      dayNumber=dayNumber & "rd"
elseif lastDigit >= 4 or lastDigit = 0 or dayNumber = 11 or dayNumber = 12 then
      dayNumber=dayNumber & "th"
end if
friendlyDate=(weekdayname(weekday(dtmDate)) & " " & dayNumber & " " & monthname(month(dtmDate)) & ", " & year(dtmDate) )
end function
%>

When I make that change I get the following message:

Dundas.Mailer.1 error '80004005'

The connection timed-out.

/xt_contactus.asp, line 64


What else needs to change to make this go to a current email address??
0
Comment
Question by:cormark
  • 6
  • 5
11 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18041816
cormark,

Line 64 seems to be the line below ...

objEmail.SendMail

Please confirm. Did you change anything else?  I would recommend uncommenting the timeout settings for the object since the default is probably lower.  The mailer object seems to be timing out.

objEmail.TimeOutConnect = 180
objEmail.TimeOutSend     = 120
objEmail.TimeOutReceive     = 120

Is this mail component used in any other working scripts?  It may be some server issue if other scripts also have the problem.  If another works then compare other settings for that object like the SMTP servers.  If you are missing info in this script then it would explain the failure.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:cormark
ID: 18041896
thanks for the response

I did not change anything else.  I will try uncommenting the timeout settings as suggested.  I can't see of find where this mail component is used in any other scripts that is what is driving me crazy it would seem just changing the address would work.  

Nothing has changed with script I have several backups and they are all the same.  The only thing that change was the current email address...
0
 

Author Comment

by:cormark
ID: 18048943
I tried to remove the timeout's but the same occurred.  
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18061292
Is there anything in the include file that would effect this?

The error message and the issue seem really odd.  Do you use other email components in other ASP scripts?  If so, how about changing this script to use that component?  You may even be able to use the default CDOSYS (or CDONTS if the server OS is older).

Let me know what you think or how I can help.

bol
0
 

Author Comment

by:cormark
ID: 18068595
We do not use any other email components in other ASP Scripts any email options on the website will go directly to an email account instead through a script.  There is nothing else I can see or find that I could change or that is associated with this script.  I will look into the CDOSYS and try to get that to work.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18070030
Let me know if you need some sample script to know how to use CDOSYS.

bol
0
 

Author Comment

by:cormark
ID: 18070359
Yes please that would be great....as you see from the script above it's nothing fancy just something simple that would send an email to a person for contact us information.
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 200 total points
ID: 18072779
A couple of links with examples are below.  The second is a comment on EE in a closed question (PAQ'd).

http://www.w3schools.com/asp/asp_send_email.asp
http:Q_20779650.html#9630147

Let me know how it works or if you have a question.

bol
0
 

Author Comment

by:cormark
ID: 18073302
Thanks, but I think I figured out why it's not sending, well sort of.  If I try to telnet to my mail server from that PC it can not "Could not open connection to host" if I do the telnet else where I get connected.  So I think this is the stem of my problem but I don't know why.  I try to telnet to another mail server and it works fine.  any thoughts?
0
 

Author Comment

by:cormark
ID: 18094777
Thanks for all the help.  I finally got the mail to go out, it was something with the SMTP after all that.  I couldn't even get webaccess to open from IE, I added a different SMTP server to the ASP script and it works.  Thanks for all the help!
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18095247
Your welcome!  I'm glad that I could help.  Thank you for the grade, the points and the fun question.

bol
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

830 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