Solved

Cannot send CDO.Message from Windows Server 2012

Posted on 2013-12-02
11
9,886 Views
Last Modified: 2013-12-03
Hi Experts,
I've moved my website from Windows Server 2008 to Windows Server 2012.

The problem I encountered is that I can't send email. The code below worked on the old server but it gives me an error on Windows Server 2012.

Set myMail=CreateObject("CDO.Message")
myMail.Subject= request.form("Subject") & " - Test" ' subject of the email
myMail.From= request.form("Email")
myMail.To="webmaster@mysite.com"
myMail.HTMLBody = request.form("Message") & "<b>Test</b>"
myMail.Send
set myMail=nothing


After I submit I get the following error:

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.

SMTP Server is installed on Windows Server 2012, but the email feature still doesn't work.
I would appreciate your help.
0
Comment
Question by:romsom
  • 6
  • 4
11 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 400 total points
Comment Utility
most likely a permissions issue on the IIS meta database. This article explains 3 possible solutions, one of them is a code change if you don't want to go messing with permissions:

http://blogs.msdn.com/b/akashb/archive/2010/05/24/error-cdo-message-1-0x80040220-the-quot-sendusing-quot-configuration-value-is-invalid-on-iis-7-5.aspx
0
 

Author Comment

by:romsom
Comment Utility
I've tried the methods suggested and my error message changed:

CDO.Message.1 error '80070005'

Access is denied.

The code change gave me this same error message. I don't know what to do with it.
0
 
LVL 32

Expert Comment

by:Big Monty
Comment Utility
make sure your IUSR account has access to the folder where the emails are being sent out.
0
 

Author Comment

by:romsom
Comment Utility
IUSR has access, but the error message is the same
0
 
LVL 32

Expert Comment

by:Big Monty
Comment Utility
did you try the method of changing the permissions for the meta database?
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:romsom
Comment Utility
What I'm doing is right click the web site in IIS > Edit Permissions > Security > IUSR and grant full access.
How can I change the permissions for the meta database?
0
 
LVL 32

Expert Comment

by:Big Monty
Comment Utility
taken from the link i posted:

Grant the IIS_IUSRS group read access to the /LM/SmtpSvc/ and /LM/SmtpSvc/1/ nodes in the IIS Metabase. How can you do it? You can download the Internet Information Services (IIS) 6.0 Resource Kit Tools at http://go.microsoft.com/fwlink/?LinkId=67351. This resource kit includes a Metabase Explorer that works with IIS 6.0 or IIS 7.0 with IIS 6 Management Compatibility role services installed. On IIS 7.0, the IIS Admin Service must be running for the Metabase Explorer tool to work correctly.
Why will this work? It will work because IIS 7 automatically adds the IIS_IUSRS membership to the worker processes token at runtime. By doing this, accounts that have been defined to run as 'application pool identities' no longer need to explicitly be part of the IIS_IUSRS group.
0
 

Author Comment

by:romsom
Comment Utility
I've downloaded it and I even made sure that the files are in Program Files.
I also restarted the server, but nothing changed. Isn't the problem that I have IIS 8?
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
Comment Utility
Here is an Amazon article with pictures about using IIS 6 SMTP on Server 2012: http://sesblog.amazon.com/post/TxAXMJU3AAN5JA/Using-IIS-SMTP-on-Windows-2008-2012-with-Amazon-SES
0
 

Author Comment

by:romsom
Comment Utility
I've followed the Amazon article, but I still get this error message:

CDO.Message.1 error '80070005'

Access is denied.
0
 

Author Closing Comment

by:romsom
Comment Utility
Thank you for your help; it's finally working! I needed to give write permission to the folder C: \ inetpub \ mailroot \ Pickup and that solved the problem. I also found this page helpful:
http://double-slash.net/2010/10/19/cdo-message-1-error-80070005-access-is-denied/
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

772 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