ASP.NET Send Mail - Access is denied.

  • Thread starter Thread starter Luiz Vianna
  • Start date Start date
L

Luiz Vianna

Guys,

I have a Windows 2003 running Exchange 2003.

On this machine I'm trying to run an ASP.NET webform to send an e-mail.

The codebehing my ASPX is like this:
Dim NewMail As New CDO.Message
NewMail.From = From
NewMail.To = Msgto
NewMail.CC = ""
NewMail.BCC = ""
NewMail.Subject = strMsgSubject
NewMail.HTMLBody = strMsgBody
NewMail.Send()

When I run this web form the respose is

Access is denied.

I tryied with CDO and CDOEX with the same behavior.

What I'm missing?

Thanks
 
Luiz:

I had the same problem with Windows 2003.

Try: dim NewMail as New System.Web.Mail.MailMessage

Everything worked when I used this rather than the older CDONTS that you are using.

Good Luck!

Fred


Guys,

I have a Windows 2003 running Exchange 2003.

On this machine I'm trying to run an ASP.NET webform to send an e-mail.

The codebehing my ASPX is like this:
Dim NewMail As New CDO.Message
NewMail.From = From
NewMail.To = Msgto
NewMail.CC = ""
NewMail.BCC = ""
NewMail.Subject = strMsgSubject
NewMail.HTMLBody = strMsgBody
NewMail.Send()

When I run this web form the respose is

Access is denied.

I tryied with CDO and CDOEX with the same behavior.

What I'm missing?

Thanks
 
Fred, thanks but

This method I'm using is the Microsoft CDO For Exchange 2000 Library...

This method You sugested, does not work too....

I thing I'm missing some user rights to InternetUser or ASP.NET Account.

Thanks anyway

Luiz
"Fred Nelson" <[email protected]> escreveu na mensagem Luiz:

I had the same problem with Windows 2003.

Try: dim NewMail as New System.Web.Mail.MailMessage

Everything worked when I used this rather than the older CDONTS that you are using.

Good Luck!

Fred


Guys,

I have a Windows 2003 running Exchange 2003.

On this machine I'm trying to run an ASP.NET webform to send an e-mail.

The codebehing my ASPX is like this:
Dim NewMail As New CDO.Message
NewMail.From = From
NewMail.To = Msgto
NewMail.CC = ""
NewMail.BCC = ""
NewMail.Subject = strMsgSubject
NewMail.HTMLBody = strMsgBody
NewMail.Send()

When I run this web form the respose is

Access is denied.

I tryied with CDO and CDOEX with the same behavior.

What I'm missing?

Thanks
 
Hi Luiz,
You can use SMTP for email.
You will need to install SMTP Virtual Server for your IIS from the Windows CD if you don't see Default SMTP Virtual Server menu
in the IIS console.
Here is the code you will need to use :
This is in C# but you can easily convert to VB.NET
using System.Web.Mail;



MailMessage mailObj = new MailMessage();

SmtpMail.SmtpServer = "Localhost"; // put your SmtpServer name if needed.

mailObj.From =" from email address";

mailObj.To = "to email address";

mailObj.Subject = "Your mail subject.";

mailObj.BodyFormat=MailFormat.Html;

mailObj.Body="Your mail body string";

// If you have attachments 2 lines below applicable :

MailAttachment mailattach=new MailAttachment(System.IO.Path.GetFullPath(path to the file you need to upload) + "put your file name ");

mailObj.Attachments.Add(mailattach);

SmtpMail.Send(mailObj);

Hope this helps.

Regards,

Marshal Antony

..NET Developer

http://www.dotnetmarshal.com





Fred, thanks but

This method I'm using is the Microsoft CDO For Exchange 2000 Library...

This method You sugested, does not work too....

I thing I'm missing some user rights to InternetUser or ASP.NET Account.

Thanks anyway

Luiz
"Fred Nelson" <[email protected]> escreveu na mensagem Luiz:

I had the same problem with Windows 2003.

Try: dim NewMail as New System.Web.Mail.MailMessage

Everything worked when I used this rather than the older CDONTS that you are using.

Good Luck!

Fred


Guys,

I have a Windows 2003 running Exchange 2003.

On this machine I'm trying to run an ASP.NET webform to send an e-mail.

The codebehing my ASPX is like this:
Dim NewMail As New CDO.Message
NewMail.From = From
NewMail.To = Msgto
NewMail.CC = ""
NewMail.BCC = ""
NewMail.Subject = strMsgSubject
NewMail.HTMLBody = strMsgBody
NewMail.Send()

When I run this web form the respose is

Access is denied.

I tryied with CDO and CDOEX with the same behavior.

What I'm missing?

Thanks
 
Back
Top