473,569 Members | 2,880 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(Emai lFrom.ToString( ), EmailTo.ToStrin g(), Subject.ToStrin g(),
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 1440
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******** ******@TK2MSFTN GP12.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(Emai lFrom.ToString( ), EmailTo.ToStrin g(), Subject.ToStrin g(),
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******** ******@TK2MSFTN GP12.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(st ring strSMTPServer, string strFrom, string strTo,
string strSubject, string strBody, string strCC, string strBCC, string
strAttachmentLi st, 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.BodyForm at=MailFormat.H tml;
}
else
{
objMsg.BodyForm at=MailFormat.T ext;
}

// Build an IList of mail attachments.
//A list of files separated by comma(,)
if (strAttachmentL ist != "")
{
char[] delim = new char[] {','};
foreach (string sSubstr in strAttachmentLi st.Split(delim) )
{
MailAttachment attachment = new MailAttachment( sSubstr);
objMsg.Attachme nts.Add(attachm ent);
}
}

SmtpMail.SmtpSe rver = strSMTPServer;
SmtpMail.Send(o bjMsg);
blnTemp=true;

return blnTemp;

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

"Farooq Khan" <fa*********@pk .softechww.com> wrote in message
news:eJ******** ******@TK2MSFTN GP12.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(Emai lFrom.ToString( ), EmailTo.ToStrin g(), Subject.ToStrin g(),
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******** ******@TK2MSFTN GP12.phx.gbl...
Here is the function to send mail. Be sure to use System.Web.Mail namespace.
Prodip Saha

public bool SendSMTPMail(st ring strSMTPServer, string strFrom, string strTo, string strSubject, string strBody, string strCC, string strBCC, string
strAttachmentLi st, 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.BodyForm at=MailFormat.H tml;
}
else
{
objMsg.BodyForm at=MailFormat.T ext;
}

// Build an IList of mail attachments.
//A list of files separated by comma(,)
if (strAttachmentL ist != "")
{
char[] delim = new char[] {','};
foreach (string sSubstr in strAttachmentLi st.Split(delim) )
{
MailAttachment attachment = new MailAttachment( sSubstr);
objMsg.Attachme nts.Add(attachm ent);
}
}

SmtpMail.SmtpSe rver = strSMTPServer;
SmtpMail.Send(o bjMsg);
blnTemp=true;

return blnTemp;

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

"Farooq Khan" <fa*********@pk .softechww.com> wrote in message
news:eJ******** ******@TK2MSFTN GP12.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(Emai lFrom.ToString( ), EmailTo.ToStrin g(), Subject.ToStrin g(),
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
1464
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 and (ii) a body. 2) Show the last X posts (or, better yet, just the last X titles) on a home page. 3) Show all posts on a "news" page. 4) When a...
2
1904
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 send to a list of about 30 email addresses using CDONTS. My emailing ASP script works by looping through a recordset containing the email addresses,...
0
1283
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 press the submit button however I only get the table no data in the received email. Any suggestions would be appreciated. Chuck
0
1363
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 addresses. Its sent as plain text and as i said when i tested it to 6 email addresses it worked fine. my code is below <%@LANGUAGE="VBSCRIPT"%>
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 an excerpt from the program Imports System.Web.Mai Imports System.Web.HttpServerUtilit Imports System.Diagnostics Public Class Emailin...
1
1777
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 background task instead of user need to wait and wait until all email sent. Also, when user waiting to complete the emailing list, the page is blank...
3
3026
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 App_Start handler to see if I could get emailed at all even from the first request of the app, but to no avail. Could someone please help me out? ...
4
1644
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 currently for our client/server apps.
2
2230
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 smart? what would be a reasonable number? My second question is related to emailing customers who have an anniversary or a Birthday. Is it possible...
20
1906
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 run. Now I have a number of tables in this database...looking like this: editorial editorialdate, editorialname, editorialcomments press
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.