clayo
asked on
ASPX Contact form Email
I have an old script from a contact page that I have inherited. I know nothing about aspx. I have taken a few stabs at this but have failed everytime. I get the following error
************************** ********** ********** ********** ********** **Error*** ********** ********** ********** **
Could not create an object of type 'CDONTS.NewMail'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not create an object of type 'CDONTS.NewMail'.
************************** ********** *******End Error********************* ********** ********
My code is as follows:
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c om"
EmailTo = "information@spiritcheer.c om"
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd dress"))
State = Trim(Request.Form("State") )
Company = Trim(Request.Form("Company "))
Message = Trim(Request.Form("Message "))
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h tm?" & EmailFrom)
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
' send email
Dim mail
mail = Server.CreateObject("CDONT S.NewMail" )
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
' redirect to success page
Response.Redirect("index.h tml?" & EmailFrom)
%>
************************** ********** ********** ********** ********** *End
I also know from research that this is the old way of sending mail.. Any help would be of assistance.
**************************
Could not create an object of type 'CDONTS.NewMail'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not create an object of type 'CDONTS.NewMail'.
**************************
My code is as follows:
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c
EmailTo = "information@spiritcheer.c
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd
State = Trim(Request.Form("State")
Company = Trim(Request.Form("Company
Message = Trim(Request.Form("Message
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
' send email
Dim mail
mail = Server.CreateObject("CDONT
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
' redirect to success page
Response.Redirect("index.h
%>
**************************
I also know from research that this is the old way of sending mail.. Any help would be of assistance.
ASKER
Ok I revised the code to:
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c om"
EmailTo = "clayowensby@gmail.com"
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd dress"))
State = Trim(Request.Form("State") )
Company = Trim(Request.Form("Company "))
Message = Trim(Request.Form("Message "))
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h tm?" & EmailFrom)
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
' send email
Dim mail
mail = Server.CreateObject("CDONT S.NewMail" )
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
<%
Set Mail=CreateObject("CDO.Mes sage")
Mail.Subject=Subject
Mail.From=EmailFrom
Mail.To=EmailTo
Mail.TextBody=Body
Mail.Send
set myMail=nothing
%>
' redirect to success page
Response.Redirect("index.h tml?" & EmailFrom)
%>
But got the following error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30037: Character is not valid.
Line 47: mail.Send
Line 48:
Line 49: <%
Line 50: Set Mail=CreateObject("CDO.Mes sage")
Line 51: Mail.Subject=Subject
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c
EmailTo = "clayowensby@gmail.com"
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd
State = Trim(Request.Form("State")
Company = Trim(Request.Form("Company
Message = Trim(Request.Form("Message
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
' send email
Dim mail
mail = Server.CreateObject("CDONT
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
<%
Set Mail=CreateObject("CDO.Mes
Mail.Subject=Subject
Mail.From=EmailFrom
Mail.To=EmailTo
Mail.TextBody=Body
Mail.Send
set myMail=nothing
%>
' redirect to success page
Response.Redirect("index.h
%>
But got the following error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30037: Character is not valid.
Line 47: mail.Send
Line 48:
Line 49: <%
Line 50: Set Mail=CreateObject("CDO.Mes
Line 51: Mail.Subject=Subject
ASKER
Ok so I blanked and did not take out one of the sections that you told me to..... how does this look?
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c om"
EmailTo = "clayowensby@gmail.com"
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd dress"))
State = Trim(Request.Form("State") )
Company = Trim(Request.Form("Company "))
Message = Trim(Request.Form("Message "))
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h tm?" & EmailFrom)
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
<%
Set Mail=CreateObject("CDO.Mes sage")
Mail.Subject=Subject
Mail.From=EmailFrom
Mail.To=EmailTo
Mail.TextBody=Body
Mail.Send
set myMail=nothing
%>
' redirect to success page
Response.Redirect("index.h tml?" & EmailFrom)
%>
<%
' Website Contact Form Generator
' http://www.tele-pro.co.uk/scripts/contact_form/
' This script is free to use as long as you
' retain the credit link
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim EmailAddress
Dim State
Dim Company
Dim Message
' get posted data into variables
EmailFrom = "information@spiritcheer.c
EmailTo = "clayowensby@gmail.com"
Subject = "Web Contact"
Name = Trim(Request.Form("Name"))
EmailAddress = Trim(Request.Form("EmailAd
State = Trim(Request.Form("State")
Company = Trim(Request.Form("Company
Message = Trim(Request.Form("Message
' validation
Dim validationOK
validationOK=true
If (validationOK=false) Then Response.Redirect("error.h
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "EmailAddress: " & EmailAddress & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "Company: " & Company & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
<%
Set Mail=CreateObject("CDO.Mes
Mail.Subject=Subject
Mail.From=EmailFrom
Mail.To=EmailTo
Mail.TextBody=Body
Mail.Send
set myMail=nothing
%>
' redirect to success page
Response.Redirect("index.h
%>
ASKER
I got this error....
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30037: Character is not valid.
Source Error:
Line 38: Body = Body & "Message: " & Message & VbCrLf
Line 39:
Line 40: <%
Line 41: Set Mail=CreateObject("CDO.Mes sage")
Line 42: Mail.Subject=Subject
Source File: C:\OS\public_html\New_Spir itCheer\si te_flash\c ontact.asp x Line: 40
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30037: Character is not valid.
Source Error:
Line 38: Body = Body & "Message: " & Message & VbCrLf
Line 39:
Line 40: <%
Line 41: Set Mail=CreateObject("CDO.Mes
Line 42: Mail.Subject=Subject
Source File: C:\OS\public_html\New_Spir
Hi,
I just noticed this. you cannot use ASP code in a ASPX formated file.
ASPX is ASP.NET and typically coded in VB.NET or C#. The file extentions are .aspx
ASP on the other handle is the first version of ASP.NET. Essentially it HTML with server-side scripting enabled. The file extentions are .asp.
The code generated from your site creates 2 files.
1. An contact.htm file which acts as a webform that passes the parameters to the ASP page.
2. An contact.asp File which contains the server objects to send the email.
As i mentioned earlier, I would start by reading the following (http://www.codeproject.com/KB/asp/cdoex.aspx). CDONTS is deprecated and CDOSYS is the supported format. Both links provide examples to help you set this up.
Cheers,
Hades666
I just noticed this. you cannot use ASP code in a ASPX formated file.
ASPX is ASP.NET and typically coded in VB.NET or C#. The file extentions are .aspx
ASP on the other handle is the first version of ASP.NET. Essentially it HTML with server-side scripting enabled. The file extentions are .asp.
The code generated from your site creates 2 files.
1. An contact.htm file which acts as a webform that passes the parameters to the ASP page.
2. An contact.asp File which contains the server objects to send the email.
As i mentioned earlier, I would start by reading the following (http://www.codeproject.com/KB/asp/cdoex.aspx). CDONTS is deprecated and CDOSYS is the supported format. Both links provide examples to help you set this up.
Cheers,
Hades666
ASKER
This is a great link... It still doesn't work... Where do I set up the smtp properties in asp. The server does not allow and open relay so I should need to give a username and password?
What language are you trying to write this in? .NET or regular ASP.
Thanks,
Hades666
Thanks,
Hades666
ASKER
asp
Hi Clayo,
Sorry you are having such a hardtime with this. In the forums it is always hard to gauge the users experience in programming and their environment configuration. With that said, please provide the following answers for me.
1. Do you have a smtp server installed and functioning on this webserver? If so, do you have an smart relay?To Test SMTP Server open command line and do the following:
telnet yourserverip 25
set local_echo (! only if text not showing up)
helo
mail from:servername@yourdomain .com
rcpt to: youremail@yourdomain.com
data
This is a test msg from the smtp server.
. (! Finish and send the msg with a period like such)
This will test your smtp server configuration. If you don't receive and email of get a denied error, then you have SMTP configuration issues and no smarthost smtp relay configured. We can correct this if that happens.
2. CDONTS CODE TO SENDEMAIL. Create an asp file called sendemail.asp with the following code between the ========. This code uses the CDONTS.DLL format even though it is deprecated. This does depend on CDONTS being registered if you are working off a windows 2003/2008 server.
CHANGE - yoursmtprelay.yourdomain.c om
CHANGE - youremail@yourdomain.com
========
<%
If Request.Form("btnSubmit") <> "" Then
Dim UserName
Dim UserMessage
UserName = Request.Form("txtName")
UserMessage = Request.Form("txtMessage")
Dim Message
Message = Message & "User " & UserName & " left the following message: " & UserMessage
Dim oMessage
Set oMessage = Server.CreateObject("CDONT S.NewMail" )
With oMessage
.To = "youremail@yourdomain.com"
.From = "servername@yourdomain.com "
.Subject = "User " & UserName & " left a message"
.Body = Message
.Send
End with
Set oMessage = Nothing
End If
%>
<html>
<head></head>
<body>
<form id="frmSendEmail" method="post" action="sendemail.asp">
Your name: <input type="text" name="txtName" id="txtName" /><br />
Your message: <input type="text" name="txtMessage" id="txtMessage" /><br />
<input type="submit" name="btnSubmit" id="btnSubmit" value="Send Message" />
</form>
</body>
</html>
========
IF your SMTP Server is configured correctly, you will receive an email.
3. CDOSYS CODE TO SENDEMAIL. Create an asp file called sendemail.asp with the following code between the ========. This code uses CDOSYS to send messages.
CHANGE - yoursmtprelay.yourdomain.c om
CHANGE - youremail@yourdomain.com
CHANGE - serverip@yourdomain.com
========
<%
If Request.Form("btnSubmit") <> "" Then
Dim UserName
Dim UserMessage
UserName = Request.Form("txtName")
UserMessage = Request.Form("txtMessage")
Dim Message
Message = Message & "User " & UserName & " left the following message: " & UserMessage
Const cdoSendUsingPort = 2
Dim oConfiguration
Dim oMessage
Dim oFields
Set oMessage = CreateObject("CDO.Message" )
Set oConfiguration = CreateObject("CDO.Configur ation")
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "yoursmtprelay.yourdomain. com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
With oMessage
Set .Configuration = oConfiguration
.To = "youremail@yourdomain.com"
.From = "serverip@yourdomain.com"
.Subject = "User " & UserName & " left a message"
.HTMLBody = Message
.Send
End With
End If
%>
<html>
<head></head>
<body>
<form id="frmSendEmail" method="post" action="sendemail.asp">
Your name: <input type="text" name="txtName" id="txtName" /><br />
Your message: <input type="text" name="txtMessage" id="txtMessage" /><br />
<input type="submit" name="btnSubmit" id="btnSubmit" value="Send Message" />
</form>
</body>
</html>
========
4. Lastly, please provide the full code for you page(s). If your co-worker used http://www.tele-pro.co.uk/scripts/contact_form/. then you should have 2 files. One contact.htm and One contact.asp.
Let me know the outcome of the tests above.
Thank you,
Hades666
Sorry you are having such a hardtime with this. In the forums it is always hard to gauge the users experience in programming and their environment configuration. With that said, please provide the following answers for me.
1. Do you have a smtp server installed and functioning on this webserver? If so, do you have an smart relay?To Test SMTP Server open command line and do the following:
telnet yourserverip 25
set local_echo (! only if text not showing up)
helo
mail from:servername@yourdomain
rcpt to: youremail@yourdomain.com
data
This is a test msg from the smtp server.
. (! Finish and send the msg with a period like such)
This will test your smtp server configuration. If you don't receive and email of get a denied error, then you have SMTP configuration issues and no smarthost smtp relay configured. We can correct this if that happens.
2. CDONTS CODE TO SENDEMAIL. Create an asp file called sendemail.asp with the following code between the ========. This code uses the CDONTS.DLL format even though it is deprecated. This does depend on CDONTS being registered if you are working off a windows 2003/2008 server.
CHANGE - yoursmtprelay.yourdomain.c
CHANGE - youremail@yourdomain.com
========
<%
If Request.Form("btnSubmit") <> "" Then
Dim UserName
Dim UserMessage
UserName = Request.Form("txtName")
UserMessage = Request.Form("txtMessage")
Dim Message
Message = Message & "User " & UserName & " left the following message: " & UserMessage
Dim oMessage
Set oMessage = Server.CreateObject("CDONT
With oMessage
.To = "youremail@yourdomain.com"
.From = "servername@yourdomain.com
.Subject = "User " & UserName & " left a message"
.Body = Message
.Send
End with
Set oMessage = Nothing
End If
%>
<html>
<head></head>
<body>
<form id="frmSendEmail" method="post" action="sendemail.asp">
Your name: <input type="text" name="txtName" id="txtName" /><br />
Your message: <input type="text" name="txtMessage" id="txtMessage" /><br />
<input type="submit" name="btnSubmit" id="btnSubmit" value="Send Message" />
</form>
</body>
</html>
========
IF your SMTP Server is configured correctly, you will receive an email.
3. CDOSYS CODE TO SENDEMAIL. Create an asp file called sendemail.asp with the following code between the ========. This code uses CDOSYS to send messages.
CHANGE - yoursmtprelay.yourdomain.c
CHANGE - youremail@yourdomain.com
CHANGE - serverip@yourdomain.com
========
<%
If Request.Form("btnSubmit") <> "" Then
Dim UserName
Dim UserMessage
UserName = Request.Form("txtName")
UserMessage = Request.Form("txtMessage")
Dim Message
Message = Message & "User " & UserName & " left the following message: " & UserMessage
Const cdoSendUsingPort = 2
Dim oConfiguration
Dim oMessage
Dim oFields
Set oMessage = CreateObject("CDO.Message"
Set oConfiguration = CreateObject("CDO.Configur
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "yoursmtprelay.yourdomain.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
With oMessage
Set .Configuration = oConfiguration
.To = "youremail@yourdomain.com"
.From = "serverip@yourdomain.com"
.Subject = "User " & UserName & " left a message"
.HTMLBody = Message
.Send
End With
End If
%>
<html>
<head></head>
<body>
<form id="frmSendEmail" method="post" action="sendemail.asp">
Your name: <input type="text" name="txtName" id="txtName" /><br />
Your message: <input type="text" name="txtMessage" id="txtMessage" /><br />
<input type="submit" name="btnSubmit" id="btnSubmit" value="Send Message" />
</form>
</body>
</html>
========
4. Lastly, please provide the full code for you page(s). If your co-worker used http://www.tele-pro.co.uk/scripts/contact_form/. then you should have 2 files. One contact.htm and One contact.asp.
Let me know the outcome of the tests above.
Thank you,
Hades666
ASKER
you are right.. This is the first time that I have ever touched asp... I do not think that I have a smart relay on the box. I continue to get errors when trying your smtp process above. thank you for your help
hi Clayo,
No worries, diagnose and troubleshooting is the fun part. The challenge comes from how much detail to provide. Anyways, does your company have a smtprelay available for use? If so, try the following so see if you can relay of it. This test is the rawest form to ensure you can send email from this server.
telnet yourcompany.smtpserver.com 25
set local_echo (! only if text not showing up)
helo
mail from:servername@yourdomain .com
rcpt to: youremail@yourdomain.com
data
This is a test msg from the smtp server.
. (! Finish and send the msg with a period like such)
Next is this a company? or a home site?
cheers,
Hades666
No worries, diagnose and troubleshooting is the fun part. The challenge comes from how much detail to provide. Anyways, does your company have a smtprelay available for use? If so, try the following so see if you can relay of it. This test is the rawest form to ensure you can send email from this server.
telnet yourcompany.smtpserver.com
set local_echo (! only if text not showing up)
helo
mail from:servername@yourdomain
rcpt to: youremail@yourdomain.com
data
This is a test msg from the smtp server.
. (! Finish and send the msg with a period like such)
Next is this a company? or a home site?
cheers,
Hades666
ASKER
Ok so I have tested and can verify that I do have a smart relay on the server. this is a company site
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am going to award you the points.. You have done more than your share on this question and I really appreciate that. I have confirmed that there is a smart relay and have sent message multiple times with the cmd line scripts but I am still getting this error.
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/sendmail2.asp, line 32
I set the code up like this
With oMessage
Set .Configuration = oConfiguration
.To = "clayowensby@gmail.com"
.From = "cowensby@spiritcheer.com"
.Subject = "User " & UserName & " left a message"
.HTMLBody = Message
.Send
End With
I know that your example uses the server Ip and I tried that but I can't seem to get that to work with the cmd line example or with the code. Any suggestions?
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/sendmail2.asp, line 32
I set the code up like this
With oMessage
Set .Configuration = oConfiguration
.To = "clayowensby@gmail.com"
.From = "cowensby@spiritcheer.com"
.Subject = "User " & UserName & " left a message"
.HTMLBody = Message
.Send
End With
I know that your example uses the server Ip and I tried that but I can't seem to get that to work with the cmd line example or with the code. Any suggestions?
Hey Clayo,
No worries. Let's fix this completely.
Change --> Const cdoSendUsingPort = 1
Use the CdoSendUsing Enum to set this value. If the SMTP service is installed on the local computer, then the value defaults to cdoSendUsingPickup (1). Otherwise, if Microsoft Outlook/Express is installed, the value defaults to cdoSendUsingPort (2) and the settings from the default account are used. if it is 3 then it is directly with Exchange.
Finally, let's finish configuring your Local SMTP service this server to relay of the smarthost. Below are the settings/tabs to configure the smtp service to relay properly. It is restricted to only receive email from itself too :).
=================
General Tab
[x] Enable Logging
Access
Access Control
No Change leave Defaults
Secure communication
No Change leave Defaults
Connection Control
No Change leave Defaults
Relay restrictions
(*) Only the list below
<add>
(*) Single computer
Local.server.IP (Assigned IP)
127.0.0.1
[ ] Allow all computers which successfully authenticate to relay, regardless of list above.
Messages
[ ] Limit Message size to (KB): 20000
[ ] Limit session size to (KB): 20000
[ ] Limited number of message per connection to:
[ ] Limit number of recipients per message to:
Send copy of Non-Delivery Report to:
Leave empty
Delivery
Outbound
First retry interval (minutes): 15
Second retry interval (minutes): 30
Third retry interval (minutes): 45
Subsequent retry interval (minutes): 240
Delay notification: 12 Hours
Expiration timeout: 2 Days
Local
Delay notification: 12 Hours
Expiration timeout: 2 Days
Outbound Security button
No Change leave Defaults
Outbound Connections Button
No Change leave Defaults
Advanced Button
Maximum Hops: 15
Masquerade Domain: <empty>
FQDN: %Servername%
Smart Host: your.smtpserver.IP or DNS NAME
[ ] Attempt Direct Delivery before sending to smart host
[ ] Perform reverse DNS lookup on incoming messages
LDAP Routing
No Change leave Defaults
Security
No Change leave Defaults
Stop the Service
Start the Service for changes to take effect
================
After you change the cdosendport and setup the smtpservice, give it antoher shot.
Cheers,
Hades666
No worries. Let's fix this completely.
Change --> Const cdoSendUsingPort = 1
Use the CdoSendUsing Enum to set this value. If the SMTP service is installed on the local computer, then the value defaults to cdoSendUsingPickup (1). Otherwise, if Microsoft Outlook/Express is installed, the value defaults to cdoSendUsingPort (2) and the settings from the default account are used. if it is 3 then it is directly with Exchange.
Finally, let's finish configuring your Local SMTP service this server to relay of the smarthost. Below are the settings/tabs to configure the smtp service to relay properly. It is restricted to only receive email from itself too :).
=================
General Tab
[x] Enable Logging
Access
Access Control
No Change leave Defaults
Secure communication
No Change leave Defaults
Connection Control
No Change leave Defaults
Relay restrictions
(*) Only the list below
<add>
(*) Single computer
Local.server.IP (Assigned IP)
127.0.0.1
[ ] Allow all computers which successfully authenticate to relay, regardless of list above.
Messages
[ ] Limit Message size to (KB): 20000
[ ] Limit session size to (KB): 20000
[ ] Limited number of message per connection to:
[ ] Limit number of recipients per message to:
Send copy of Non-Delivery Report to:
Leave empty
Delivery
Outbound
First retry interval (minutes): 15
Second retry interval (minutes): 30
Third retry interval (minutes): 45
Subsequent retry interval (minutes): 240
Delay notification: 12 Hours
Expiration timeout: 2 Days
Local
Delay notification: 12 Hours
Expiration timeout: 2 Days
Outbound Security button
No Change leave Defaults
Outbound Connections Button
No Change leave Defaults
Advanced Button
Maximum Hops: 15
Masquerade Domain: <empty>
FQDN: %Servername%
Smart Host: your.smtpserver.IP or DNS NAME
[ ] Attempt Direct Delivery before sending to smart host
[ ] Perform reverse DNS lookup on incoming messages
LDAP Routing
No Change leave Defaults
Security
No Change leave Defaults
Stop the Service
Start the Service for changes to take effect
================
After you change the cdosendport and setup the smtpservice, give it antoher shot.
Cheers,
Hades666
ASKER
I must admit that I just found the issue..... I didnt change the server name... I tested it and it works... you have been great and thank you so much!
excellent. Have a good one. - Hades666
ASKER
you too
ASKER
Just for knowledge how whould I authenticate to the smtp server??
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "mail.spiritcheer.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item(cdoSendUsername) = "cowensby"
.Item(cdoSendPassword) = "GoDawgs1"
.Update
End With
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "mail.spiritcheer.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item(cdoSendUsername) = "cowensby"
.Item(cdoSendPassword) = "GoDawgs1"
.Update
End With
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"
Here are all the possiblities for this namespace.
http://msdn.microsoft.com/en-us/library/ms526318(EXCHG.10).aspx
Cheers,
Hades666
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"
Here are all the possiblities for this namespace.
http://msdn.microsoft.com/en-us/library/ms526318(EXCHG.10).aspx
Cheers,
Hades666
ASKER
this is great... thank you again.. the page works but I have not recieved the email message. How could I award you more points?
Don't worry about it. Glad i could help.
Just wait and see it the email appears, sometimes going through a local smtp server then through a smarthost, the queue is a little slower then testing directly via command line and telnet.
Just hold tight.
Cheers, Hades666
Just wait and see it the email appears, sometimes going through a local smtp server then through a smarthost, the queue is a little slower then testing directly via command line and telnet.
Just hold tight.
Cheers, Hades666
ASKER
here is the code
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "mail.xxxxxx.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxx"
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxxx"
.Update
End With
Still no email
Set oFields = oConfiguration.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "mail.xxxxxx.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxx"
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxxx"
.Update
End With
Still no email
Make sure that CDONTS.dll has been registered with the command:
regsvr32 C:\WINDOWS\System32\CDONTS
With that said, I would suggest using CDOSYS. CDONTS is deprecated.
http://www.w3schools.com/asp/asp_send_email.asp
Same structure, just a supported dll for windows2003.
Cheers,
Hades666