In order to fix this you will need “Metabase Explorer” which is part of the IIS 6.0 Resource Kit. Once you have Metabase Explorer running you can add the missing keys and grant permissions. In Metabase Explorer (you will have to right click it and run it as administrator) you will see something similar to this screen shot;
You should not see the two keys that are indicated by red arrows. You will be adding these, but first let's make a backup of the LM key and its children;
- Right click LM->Export to file
- Select a folder where you want your backup
- Enter a backup filename
- Click Save
- Enter a password and confirm.
- Right click LM->New->Key
- Give it the name “SmtpSvc” and hit enter.
- Right click SmtpSvc->New->Key
- Give it the name “1” and hit enter.
- Right click 1->New->String Record
- In Record Name or Identifier, type “PickupDirectory” and click OK.
- Right click PickupDirectory->Properties.
- In Value Data, enter the folder where you want your emails dropped. In my case that is “c:\inetpub\mailroot\pickup”
- Click OK.
- Right click SmtpSvc->Permissions...
- You will be prompted to indicate the way you want to set permissions. Clicking “No” will copy the parent permissions down to this key and let you edit them. Click “No”.
- Select or Add the correct user.
- Make sure the “Allow” check box is checked for “Read” permission.
- Click OK.
- Repeat steps 1 through 4 for the “SmtpSvc\1” key.
Now you should be able to run your code and have email delivered as .eml files directly to your pickup folder, rather than being sent to an SMTP server. For my purposes this is exactly what I need, since I would rather have the email dropped locally where I can look at it, instead of being sent as a real email. For testing purposes it’s perfect because you don’t run the risk of having messages blasted out to customers when you are only testing something.
