Access to the path 'C:\inetpub\mailroot\Pickup\75db1061-bd15-4893-93d9-2477dee27983.eml' is denied.

J

Jeff

hi

asp.net 3.5
websesrver IIS7

I'm trying to send email from my website and get this error:
"Access to the path
'C:\inetpub\mailroot\Pickup\75db1061-bd15-4893-93d9-2477dee27983.eml' is
denied."

This is the code I use to send with:
MailMessage msg = md.CreateMailMessage(recipient, replacements, this);
SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
client.Send(msg);
msg.Dispose();

this is the web.config settings
<system.net>
<mailSettings>
<smtp>
<network host="localhost" password="" userName="" />
</smtp>
</mailSettings>
</system.net>

I've installed SMTP Server on the server, the server is a win2k8 machine

any ideas what I'm doing wrong here?
 
K

Kornél Pál

Hi,

If you want to use the pickup directory, grant access for writing to
your web application.

If you want to use SMTP you shouldn't configure the SmtpClient to use
the pickup directory (PickupDirectoryFromIis), use SmtpDeliveryMethod
..Network instead.

Kornél
 
K

Kornél Pál

Hi,

If you want to use the pickup directory, grant access for writing to
your web application.

If you want to use SMTP you shouldn't configure the SmtpClient to use
the pickup directory (PickupDirectoryFromIis), use SmtpDeliveryMethod
..Network instead.

Kornél
 
J

Jeff

with network (SmtpDeliveryMethod.Network) I get this error:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for
<email>

any ideas?
 
J

Jeff

with network (SmtpDeliveryMethod.Network) I get this error:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for
<email>

any ideas?
 
K

Kornél Pál

Hi,

You should configure your SMTP server properly. Note that you are able
to connect to the SMTP server, it's just not accepting your your
request. Relaying means that it will accept any recipient and send it to
the right address (SMTP server) so you should be careful not to expose
your server to spammers to be used for sending their spam.

Note that neither configuring pickup nor configuring SMTP is related to
..NET so if you need help to configure your mail server you should use
another newsgroup because people there have more experience with
administrator tasks.

..NET is working properly in both cases you just either should grant
access to the picup directory or configure your SMTP server to accept
your e-mails.

Kornél
 
K

Kornél Pál

Hi,

You should configure your SMTP server properly. Note that you are able
to connect to the SMTP server, it's just not accepting your your
request. Relaying means that it will accept any recipient and send it to
the right address (SMTP server) so you should be careful not to expose
your server to spammers to be used for sending their spam.

Note that neither configuring pickup nor configuring SMTP is related to
..NET so if you need help to configure your mail server you should use
another newsgroup because people there have more experience with
administrator tasks.

..NET is working properly in both cases you just either should grant
access to the picup directory or configure your SMTP server to accept
your e-mails.

Kornél
 
C

Cowboy \(Gregory A. Beamer\)

Looking at the thread, you have two issues:

1. need to grant permissions to the ASP.NET account - appears you have done
this
2. Set up relay permissions

For #2, open the IIS manager and go to the SMTP root. Right click and choose
properties. On the Access tab, choose Relay Restrictions and grant relay to
the IP you app is on.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
 
C

Cowboy \(Gregory A. Beamer\)

Looking at the thread, you have two issues:

1. need to grant permissions to the ASP.NET account - appears you have done
this
2. Set up relay permissions

For #2, open the IIS manager and go to the SMTP root. Right click and choose
properties. On the Access tab, choose Relay Restrictions and grant relay to
the IP you app is on.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top