cormark
asked on
ASP Dundas Mailer
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("emai l")
if sendersEmail="" then
sendersEmail = "techsupport1@cormarkinc.c om"
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("Dunda s.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-AE 6D-11cf-96 B8-4445535 40000" 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.sw f"><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-shockw ave-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"> </ 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"> </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.gi f" 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(strWo rd,1)) & lcase(right(strWord,len(st rWord)-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(dtmDat e),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(dt mDate)) & " " & 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??
<!--#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("emai
if sendersEmail="" then
sendersEmail = "techsupport1@cormarkinc.c
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("Dunda
'objEmail.SMTPRelayServers
'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.
'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
'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-AE
<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"> </
<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"> </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.gi
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
Set objEmail = Nothing 'release resources
%>
<%
function titleCase(strWord)
if not strWord = "" then
titleCase=ucase(left(strWo
else
titleCase=""
end if
end function
function unhtml(strText)
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,"<
strText=replace(strText,""
strText=replace(strText,"<
unhtml=strText
end function
function friendlyDate(dtmDate)
lastDigit=right(day(dtmDat
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(
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??
ASKER
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...
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...
ASKER
I tried to remove the timeout's but the same occurred.
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
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
ASKER
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.
Let me know if you need some sample script to know how to use CDOSYS.
bol
bol
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
ASKER
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!
Your welcome! I'm glad that I could help. Thank you for the grade, the points and the fun question.
bol
bol
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