• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Using CDONTS and SMTP with a netgear firewall

I am running multiple website on a server running iis 6.0. The sites all use CDONTS to send mail using SMTP. The server is configured as an SMTP server and has a static IP address. Everything was working fine untill I added a netgear firewall (FVX538). Now I just can't send mail. It does get added to the mail queue but then never gets sent. Iv've opened up port 25 and routed it to the box. Is there anything I'm missing or need to do?

0
philipmcrouch
Asked:
philipmcrouch
  • 2
2 Solutions
 
Sam PanwarSr. Server AdministratorCommented:
Hi,

You are using window 2000 server or higher you can also try with the following code if you are using window 2003 server

Use following code for CDOSYS Email componets.
<%
Set cdoConfig = Server.CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(sch & "sendusing") = 2
cdoConfig.Fields.Item(sch & "smtpserver") = "mail.yourdomain.com"
cdoConfig.fields.update
Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = test@yourdomain.com
cdoMessage.To = "test@medomain.com"
cdoMessage.cc = "test@otherdomain.com"
cdoMessage.Subject = "enquiry form CDOSYS componets"
cdoMessage.HTMLBody = "your text"
cdoMessage.Send
Set cdoMessage = Nothing
Set cdoConfig = Nothing
response.redirect= "http://www.yourdomain.com"
%>

#
CDONTs is no longer supported on Windows 2003 server.  Microsoft   introduced CDO/CDOSYS back several years ago to replace CDONTs.
 
#
You will need to convert your code to use CDO/CDOSYS.Sample code for CDO can be found in article "How to use CDOSYS Email?"

FOR CDONTS

01. <%
02. Dim objCDOMail
03. Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
04. objCDOMail.From = "fromEmail@fromDomain.com"
05. objCDOMail.To = "toEmail@toDomain.com"
06. objCDOMail.Cc = "ccEmail@ccDomain.com"
07. objCDOMail.Bcc = "bcc@mailDomain.com"
08. objCDOMail.Subject = "Subject"
09. objCDOMail.BodyFormat = 0
10. objCDOMail.MailFormat = 0
11. objCDOMail.Body = "MailBody"
12. objCDOMail.Importance = 1
13. objCDOMail.Send
14. Set objCDOMail = Nothing
15. %>
 
Explanation According to Line
01. Open ASP tag
02. Declare a variable named objCDOMail
03. Create instance of Mailer control
04. Set Mailer control properties and collection items
05. Set Mailer control properties and collection items
06. Set Mailer control properties and collection items
07. Set Mailer control properties and collection items
08. Set Mailer control properties and collection items
09. Set Mailer control properties and collection items
10. Set Mailer control properties and collection items
11. Set Mailer control properties and collection items
12. Set Mailer control properties and collection items
13. Send Mail
14. Release resources
15. Close ASP tag
0
 
Sam PanwarSr. Server AdministratorCommented:
hi,

also open port 445 port then try its working or not.

This is your firewall problem and you can just check it throough the following

You may perform the following test to confirm the SMTP server is online and responding:
1. Start > Run > cmd (WinNT/XP/2003) or Start > Run > command (Win95/98)
2. Type command: telnet mail.domainname.com 25 (Example as below)

c:\telnet mail.YourDomain.com 25
Connecting To mail.YourDomain.com..._&#65533;

You should receive some response as below:

220- domainname.com ESMTP Exim 4.50 #1 Tue, 21 Jun 2005 07:30:42 +0800
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.&#65533;

The message confirmed that the SMTP server is working properly.
0
 
Leon FesterCommented:
The above is 100% correct, however iis 6.0 is installable without Windows 2003 i.e. can be installed on Win2K and WinXP, and CDONTS can be installed on Windows 2003.

If your mail is being formed and you've opened your ports on the firewall correctly...then firstly look at your SMTP logfiles that IIS creates. It should give you at least an error from the SMTP server.

Lastly, try sending to a local email address that does not need to travel via the firewall...this should allow you to test local sending without accessing the firewall.

If this fails, then restart your SMTP server in  IIS.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now