473,587 Members | 2,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP: Error when sending email in VB.NET

I am making a simple VB.NET app to send emails. I put a test button on the
form with code like this:
Imports System.Web.Mail
:
Dim msgEmail As New System.Web.Mail .MailMessage

With msgEmail
.To = txtTestEmailAdd ress.Text
.From = "so*****@somewh ere.com"
.Body = "This is a test email."
.Subject = "Test Email."
.BodyFormat = Web.Mail.MailFo rmat.Text
End With

System.Web.Mail .SmtpMail.SmtpS erver = "smtp.fdn.c om"
System.Web.Mail .SmtpMail.Send( msgEmail)
MessageBox.Show ("Message sent to " & msgEmail.To & ".")

Running it locally works fine. When I upload it to the server and run the
app, clicking on the button produces this error:
Could not access 'CDO.Message' object. - System.Web - at
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args)
at System.Web.Mail .CdoSysHelper.S end(MailMessage message)
at System.Web.Mail .SmtpMail.Send( MailMessage message)
at AutomatedPowerw ebEmailSystem.f rmMain.txtSendT estEmail_Click( Object
sender, EventArgs e)

Any ideas?

Thanks.
Nov 20 '05 #1
1 1197
* "VB Programmer" <gr*********@ go-intech.com> scripsit:
I am making a simple VB.NET app to send emails. I put a test button on the
form with code like this:
Imports System.Web.Mail
:
Dim msgEmail As New System.Web.Mail .MailMessage

With msgEmail
.To = txtTestEmailAdd ress.Text
.From = "so*****@somewh ere.com"
.Body = "This is a test email."
.Subject = "Test Email."
.BodyFormat = Web.Mail.MailFo rmat.Text
End With

System.Web.Mail .SmtpMail.SmtpS erver = "smtp.fdn.c om"
System.Web.Mail .SmtpMail.Send( msgEmail)
MessageBox.Show ("Message sent to " & msgEmail.To & ".")

Running it locally works fine. When I upload it to the server and run the
app, clicking on the button produces this error:
Could not access 'CDO.Message' object. - System.Web - at
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args)
at System.Web.Mail .CdoSysHelper.S end(MailMessage message)
at System.Web.Mail .SmtpMail.Send( MailMessage message)
at AutomatedPowerw ebEmailSystem.f rmMain.txtSendT estEmail_Click( Object
sender, EventArgs e)


Did you have a look here?

<http://groups.google.c om/groups?q=dotnet +cdo.message>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

8
5460
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
6
4974
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a...
3
372
by: dgiagio | last post by:
Hi, I'm creating a SMTP application and I would like to hear opinions about error handling. Currently there are two functions that communicate with the remote peer: ssize_t smtp_puts(smtp_stream_t *stream, const char *fmt, ...); ssize_t smtp_gets(smtp_stream_t *stream, char *buf, size_t len); Both of them return the number of written...
17
2073
by: freemann | last post by:
Can anyone provide example code showing how to send form results to a results page, email and a comma delimited file? Notice that I need it going to all three locations. Details: I have forms created and working. The first form the user fills out and submits. The form properties are set to Send to other: "Custom ISAPI, NSAPI, CGI, OR ASP...
1
1415
by: manohar208 | last post by:
<html> <head> <title>Trang goi mail</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <?php $to = "vytien123@yahoo.com"; $from = "vytien83@yahoo.com";
0
5546
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
11
26557
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my...
9
3448
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 oSMTP.Send(oMailMessage) (in this line I am getting the above err)
2
1924
by: ornto | last post by:
Hi, I'm trying to create an application which checks a dynamic web site and on certain events sends an email to me. My problem though is with the email task. By now I made this simple test code: #prova invio email smtpserver = smtplib.SMTP(mailserver) messaggio= "Messaggio di prova" print mail print messaggio
2
234
by: ahmadoubay_20240 | last post by:
The assignment aims at enforcing the encryption and communication techniques. It helps the student in acquiring the necessary knowledge in developing client/server application and in securing data transfer using encryption techniques. Objectives can be summarized as: • Designing and implementing server applications • Designing and...
0
7915
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
8205
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
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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...
0
6619
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
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
1452
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.