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

IIS 7 CDO Email - The transport failed to connect to the server.

Hi,
trying to send an email from a form on IIS7 on a VPS but getting the following error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.

I understand its an smtp server issue.

My code is below.

Where have I gone wrong or is there IIS by default on IIS7?


<!-- 
    METADATA 
    TYPE="typelib" 
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library" 
-->  	

<%		
	'create the mail object and send the details
	Set NewMailObj=CreateObject("CDO.Message")
	NewMailObj.From = emailAddress
	'NewMailObj.To = ""
	NewMailObj.Bcc = ""
	NewMailObj.Subject = "Web Contact Form " 
	NewMailObj.HTMLBody = emailbody
	

	NewMailObj.Configuration.Fields.Item _
	("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
	'Name or IP of remote SMTP server
	NewMailObj.Configuration.Fields.Item _
	("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
	="vps-name"
	
	'Server port
	NewMailObj.Configuration.Fields.Item _
	("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
	=25 
	NewMailObj.Configuration.Fields.Update

	
	NewMailObj.Send
	Set NewMailObj = nothing

Open in new window

0
harris9999
Asked:
harris9999
  • 2
1 Solution
 
wolfman007Commented:
The SMTP server is not installed by default. SMTP can be added through the Features Summary area of the Server Manager tool in Windows ServerĀ® 2008

Have a look at the following website for instructions on how to install SMTP on Windows Server 2008

Installing IIS 7.0 with SMTP on Windows Server 2008
http://www.jppinto.com/index.php/2009/02/installing-iis-70-with-smtp-on-windows-server-2008/

Then you will need to configure it

Configure SMTP E-mail (IIS 7)
http://technet.microsoft.com/en-us/library/cc772058(WS.10).aspx
0
 
harris9999Author Commented:
Cheers, had a look at that, SMTP Server was already installed.
I have the SMTP Email set as it is in the attached pic.

So shoudl my configuraton not be:

      NewMailObj.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
      'Name or IP of remote SMTP server
      NewMailObj.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
      ="localhost"
      
      'Server port
      NewMailObj.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
      =25
      NewMailObj.Configuration.Fields.Update

Still getting this error message though:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.
 

smtp.gif
0
 
harris9999Author Commented:
Found that the SMTP Servie wasn't running.  I've set it to start automatic so that should pretty much be it?
Emails are sending now anyway.
0

Featured Post

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.

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