473,385 Members | 1,730 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,385 software developers and data experts.

Problems with SMTP server- can not access CDO object error...

Hi:

I'm trying to send e-mail using SMTP class. I'm getting error "Could not
access CDO.Message object." I know my SMTP server is working because I
can drop a text file message in "Pick-up" directory and it gets sent to
destination. It also works when I set SmtpMail.SmtpServer
prop to my ISP's smtp server (smtp.comcast.net), but not when I point to my
local server. I have tried using SmartHost, but still get same message. I
must be missing something????????
// Format email message
string from = txtEmail.Text;
string to = "ch*****@comcast.net";
string subject = "Web Contact" ;
string body = "Name: " + txtFname.Text + " " + txtLname.Text + '\n' +
"Phone: " + txtPhone.Text + '\n' +
"Organization: " + txtOrg.Text + '\n' +
"Message: " + txtMsg.InnerHtml;
try
{
// Send message
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(from, to, subject, body);
lblMsg.Text = "Mail sent, thank you.";
}
catch (Exception excp)
{
lblMsg.Text = excp.Message;
}

Thanks,
Charlie
Nov 16 '05 #1
0 1619

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

Similar topics

2
by: Karl Ehr | last post by:
I have written the following simple program to monitor a single URL, and notify me via email whenever this URL changes. Intermittently, I raise the following exception: Traceback (most recent...
8
by: Jon Hewer | last post by:
hi having a few problems sending an email with smtplib. i do have an smtp server running on port 25 of my local machine here's the relevant code (taken from python docs): s =...
9
by: Russell Stevens | last post by:
I generate pdf files on my server and allow users to access them via a browser and also email them. Most files work fine whether the user uses his browser or gets an email with a pdf attachment...
8
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New...
2
by: oliu321 | last post by:
Hi, First I am not trying to write a client to talk with hotmail straightly. I am trying to write some codes to send emails through a SMTP server. I wrote a C++ version using pure socket...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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...

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.