473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

sending mail giving an exception

hi ,
When i tried to send mails by using smtp authentication it was giving an
exception
"Could not access 'CDO.Message' object.". can any body help me.
string smtpServer = "smtp.domain.com";
string userName = "userid";
string password = "password";
int cdoBasic = 1;
int cdoSendUsingPort = 2;
MailMessage msg = new MailMessage();
if (userName.Length 0)
{
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver",
smtpServer);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
25) ;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",
cdoSendUsingPort) ;
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
cdoBasic);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
userName);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
password);
}
msg.To = "hi@domain.com";
msg.From = na**@domain.com;
msg.Subject = "Hi ra";
msg.Body = "text";
SmtpMail.SmtpServer = smtpServer;
SmtpMail.Send(msg);
Sep 13 '06 #1
1 1219
Check out http://www.systemwebmail.com/faq/4.2.3.aspx. This might be of
help.

Regards,
Augustin
http://augustinprasanna.blogspot.com
"kamal" <ka******@nannacomputers.comwrote in message
news:u0**************@TK2MSFTNGP05.phx.gbl...
hi ,
When i tried to send mails by using smtp authentication it was giving an
exception
"Could not access 'CDO.Message' object.". can any body help me.
string smtpServer = "smtp.domain.com";
string userName = "userid";
string password = "password";
int cdoBasic = 1;
int cdoSendUsingPort = 2;
MailMessage msg = new MailMessage();
if (userName.Length 0)
{

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver",
smtpServer);

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
25) ;

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",
cdoSendUsingPort) ;

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
cdoBasic);

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
userName);

msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
password);
}
msg.To = "hi@domain.com";
msg.From = na**@domain.com;
msg.Subject = "Hi ra";
msg.Body = "text";
SmtpMail.SmtpServer = smtpServer;
SmtpMail.Send(msg);

Sep 13 '06 #2

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

Similar topics

13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
9
by: savvy | last post by:
i'm trying to compile a simple console application for sending a mail, my main idea is to schedule it to a particular time for sending mails using the windows schedular task lateron. Therefore i...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: HK | last post by:
In VB.NET, I'm getting the exception "failure sending mail". I'm running VS 2005 on XP Home. This is a new install on a new PC. I've never had email problems with VS 2003, and there I could...
7
by: Ray Booysen | last post by:
Hi all I'm sending email via ASP.NET in HTML mode. Each email has exactly one attachment and I do have full access to the SMTP server. However, if I send the email in HTML format, the...
5
by: dskinibbyb | last post by:
Hi to every one, I am having a problem while sending mail from my application. iI want to send mail from my Vb.Net applications. and it is working fine in my system, but the problem is that when i...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
2
by: Danny | last post by:
Hi all, Trying to send mail with System.Net.SmtpClient, using very simple code just for testing: SmtpClient smtp = new SmtpClient("mail.server.com", 25); smtp.Credentials = new...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
4
by: =?Utf-8?B?R3V5IENvaGVu?= | last post by:
Hi all I use: Dim message As New MailMessage(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(message) And its...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.