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

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 = txtTestEmailAddress.Text
.From = "so*****@somewhere.com"
.Body = "This is a test email."
.Subject = "Test Email."
.BodyFormat = Web.Mail.MailFormat.Text
End With

System.Web.Mail.SmtpMail.SmtpServer = "smtp.fdn.com"
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.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at AutomatedPowerwebEmailSystem.frmMain.txtSendTestEm ail_Click(Object
sender, EventArgs e)

Any ideas?

Thanks.
Nov 20 '05 #1
1 1186
* "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 = txtTestEmailAddress.Text
.From = "so*****@somewhere.com"
.Body = "This is a test email."
.Subject = "Test Email."
.BodyFormat = Web.Mail.MailFormat.Text
End With

System.Web.Mail.SmtpMail.SmtpServer = "smtp.fdn.com"
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.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at AutomatedPowerwebEmailSystem.frmMain.txtSendTestEm ail_Click(Object
sender, EventArgs e)


Did you have a look here?

<http://groups.google.com/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
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 -------------------------------------------------------------------------------- ...
6
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...
3
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...
17
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...
1
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 =...
0
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...
11
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...
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...
2
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: ...
2
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...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
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.