ASP.NET Send Mail - Access is denied.

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
 
F

Fred Nelson

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
 
L

Luiz Vianna

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
 
M

Marshal Antony

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,879
Messages
2,569,939
Members
46,232
Latest member
DeniseMcVi

Latest Threads

Top