473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

emailing in ASP.NET

hi,
i'm using CDONTS component for emailing through one of my web service like
this

// Start of code
// 'email' is the CDONTS object name

email.send(EmailFrom.ToString(), EmailTo.ToString(), Subject.ToString(),
Body.ToString(), 1)

// End of code
the above call throws an exception with the message saying "Access is
denied.". i'm using Windows 2000 Professional. don't know what i'm doing
wrong over here. help me on this!!!

Thanks.

Farooq Khan
Nov 18 '05 #1
4 1436
i have even tried using Web.SmtpMail class' send() method for this.....but
it throws "Could not access 'CDO.Message' object." exception.

"Farooq Khan" <fa*********@pk.softechww.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
hi,
i'm using CDONTS component for emailing through one of my web service like
this

// Start of code
// 'email' is the CDONTS object name

email.send(EmailFrom.ToString(), EmailTo.ToString(), Subject.ToString(),
Body.ToString(), 1)

// End of code
the above call throws an exception with the message saying "Access is
denied.". i'm using Windows 2000 Professional. don't know what i'm doing
wrong over here. help me on this!!!

Thanks.

Farooq Khan

Nov 18 '05 #2

"Farooq Khan" <fa*********@pk.softechww.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
i have even tried using Web.SmtpMail class' send() method for this.....but
it throws "Could not access 'CDO.Message' object." exception.


This "Could not access" message seems to be a general error message. The
system
usually CAN access that message object, the problem is further down.
Somewhere in the InnerException list there are probably more useful
errormessages.

Hans Kesting
Nov 18 '05 #3
Here is the function to send mail. Be sure to use System.Web.Mail namespace.

Prodip Saha

public bool SendSMTPMail(string strSMTPServer, string strFrom, string strTo,
string strSubject, string strBody, string strCC, string strBCC, string
strAttachmentList, bool blnUseHTML)
{
bool blnTemp=false;
try
{
MailMessage objMsg = new MailMessage();
objMsg.From = strFrom;
objMsg.To = strTo;
objMsg.Subject = strSubject;
objMsg.Body = strBody;
if (strCC !="")
{
objMsg.Cc = strCC;
}
if (strBCC !="")
{
objMsg.Bcc = strBCC;
}
if(blnUseHTML==true)
{
objMsg.BodyFormat=MailFormat.Html;
}
else
{
objMsg.BodyFormat=MailFormat.Text;
}

// Build an IList of mail attachments.
//A list of files separated by comma(,)
if (strAttachmentList != "")
{
char[] delim = new char[] {','};
foreach (string sSubstr in strAttachmentList.Split(delim))
{
MailAttachment attachment = new MailAttachment(sSubstr);
objMsg.Attachments.Add(attachment);
}
}

SmtpMail.SmtpServer = strSMTPServer;
SmtpMail.Send(objMsg);
blnTemp=true;

return blnTemp;

}
catch(Exception ex)
{
throw ex;
}
}

"Farooq Khan" <fa*********@pk.softechww.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
hi,
i'm using CDONTS component for emailing through one of my web service like
this

// Start of code
// 'email' is the CDONTS object name

email.send(EmailFrom.ToString(), EmailTo.ToString(), Subject.ToString(),
Body.ToString(), 1)

// End of code
the above call throws an exception with the message saying "Access is
denied.". i'm using Windows 2000 Professional. don't know what i'm doing
wrong over here. help me on this!!!

Thanks.

Farooq Khan

Nov 18 '05 #4
thanks saha,
but it doesn't work either. infact that's exactly what i have been doing.
dont know what is wrong with it. anyway thanks for ur help.

Farooq Khan
"Prodip Saha" <ps***@bear.com> wrote in message
news:uB**************@TK2MSFTNGP12.phx.gbl...
Here is the function to send mail. Be sure to use System.Web.Mail namespace.
Prodip Saha

public bool SendSMTPMail(string strSMTPServer, string strFrom, string strTo, string strSubject, string strBody, string strCC, string strBCC, string
strAttachmentList, bool blnUseHTML)
{
bool blnTemp=false;
try
{
MailMessage objMsg = new MailMessage();
objMsg.From = strFrom;
objMsg.To = strTo;
objMsg.Subject = strSubject;
objMsg.Body = strBody;
if (strCC !="")
{
objMsg.Cc = strCC;
}
if (strBCC !="")
{
objMsg.Bcc = strBCC;
}
if(blnUseHTML==true)
{
objMsg.BodyFormat=MailFormat.Html;
}
else
{
objMsg.BodyFormat=MailFormat.Text;
}

// Build an IList of mail attachments.
//A list of files separated by comma(,)
if (strAttachmentList != "")
{
char[] delim = new char[] {','};
foreach (string sSubstr in strAttachmentList.Split(delim))
{
MailAttachment attachment = new MailAttachment(sSubstr);
objMsg.Attachments.Add(attachment);
}
}

SmtpMail.SmtpServer = strSMTPServer;
SmtpMail.Send(objMsg);
blnTemp=true;

return blnTemp;

}
catch(Exception ex)
{
throw ex;
}
}

"Farooq Khan" <fa*********@pk.softechww.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
hi,
i'm using CDONTS component for emailing through one of my web service like this

// Start of code
// 'email' is the CDONTS object name

email.send(EmailFrom.ToString(), EmailTo.ToString(), Subject.ToString(),
Body.ToString(), 1)

// End of code
the above call throws an exception with the message saying "Access is
denied.". i'm using Windows 2000 Professional. don't know what i'm doing
wrong over here. help me on this!!!

Thanks.

Farooq Khan


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1462
by: Jonathan M. Rose | last post by:
I am looking for a script that I can sit on an HTML server (Linux, Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things: 1) Post news articles that consists of (i) a title...
2
1901
by: Paul Hudson | last post by:
Ive developed a web based system where somebody can add a news record using ASP and MS Access database connectivity. The new record is inserted into the database and then a formatted email gets...
0
1281
by: Chuck | last post by:
Good Morning: Has anyone in this newsgroup had experience with emailing changes made on a xml datagrid using ASPEmail? I currently have the table loading correctly with the correct data. When I...
0
1353
by: Steven Scaife | last post by:
There seems to be a problem with my emailing code, although during testing it worked fine. What happens is it sends two emails instead of one, and also doesn't put any text in the email for some...
1
341
by: Bob-O | last post by:
Need your help in sending an email message with an attachment in my VB.Net program. Sending a body message is no problem. I don't know how to use the attachment property in an emai Following is...
1
1774
by: Stanley Cheung | last post by:
Hi all, I am developing the application for send emailing list, actually, i can perform to send a email 1 by 1 and do it on aspx page. I have a enquiry that how can the application change to...
3
3019
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
4
1634
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
2
2222
by: Tim Hunter | last post by:
I have two questions regarding emailing from Access. My first question relates to how many email addresses is too much. I have a client who wants to email 1500 people at once. Is this possible or...
20
1894
by: paul814 | last post by:
I've been working on this for some time now and have gotten nowhere...hoping someone here can help. I want to take and email all records in a database for the current date when this php page is...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.