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

  • Thread starter Thread starter Jeff
  • Start date Start date
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?
 
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
 
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
 
with network (SmtpDeliveryMethod.Network) I get this error:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for
<email>

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

any ideas?
 
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
 
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
 
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! |
*************************************************
 
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! |
*************************************************
 
Back
Top