Solved

ASP Dundas Mailer

Posted on 2006-11-29
11
1,836 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
Comment Utility
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
Comment Utility
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
Comment Utility
I tried to remove the timeout's but the same occurred.  
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 54

Expert Comment

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

bol
0
 

Author Comment

by:cormark
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Your welcome!  I'm glad that I could help.  Thank you for the grade, the points and the fun question.

bol
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Webdav server error 405 using iannotate on ipad 11 134
ASP VB... 7 92
pass url parameter as session 9 40
ASP SQL Syntax Duplicate Key 7 63
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 information …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

11 Experts available now in Live!

Get 1:1 Help Now