473,776 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Web.Mail send mail fails

Using the procedure below on an ordinary form works fine. Moving it to
a service-project makes it fail on SmtpMail.Send(m ail) with error:

"Could not access 'CDO Message' object."

Google-search shows other with similar problems when running in a
service, but I didn't reach a solution.

Any ideas as to what might be wrong?

Using the System.Web.Mail :

Sub SendMail(ByVal SendTo As String, ByVal Capacity As Int64)

WriteLog("sendm ail triggered")
Try
Dim mail As New MailMessage
mail.To = Modtager
mail.From = "me"
mail.Subject = "Alert: lack of space"
mail.Body = "Space left: " & Capacity & "MB"
SmtpMail.SmtpSe rver = mySMTPserver
SmtpMail.Send(m ail)
Catch ex As Exception
WriteLog("Email error: " & ex.Message)
End Try
End Sub

Regards /snedker
Nov 21 '05 #1
4 1610
It could be a credentials problem?

See if it is addressed here: http://systemwebmail.com/

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Morten Snedker" <morten_spammen ot_ATdbconsult. dk> escribió en el mensaje
news:dj******** *************** *********@4ax.c om...
Using the procedure below on an ordinary form works fine. Moving it to
a service-project makes it fail on SmtpMail.Send(m ail) with error:

"Could not access 'CDO Message' object."

Google-search shows other with similar problems when running in a
service, but I didn't reach a solution.

Any ideas as to what might be wrong?

Using the System.Web.Mail :

Sub SendMail(ByVal SendTo As String, ByVal Capacity As Int64)

WriteLog("sendm ail triggered")
Try
Dim mail As New MailMessage
mail.To = Modtager
mail.From = "me"
mail.Subject = "Alert: lack of space"
mail.Body = "Space left: " & Capacity & "MB"
SmtpMail.SmtpSe rver = mySMTPserver
SmtpMail.Send(m ail)
Catch ex As Exception
WriteLog("Email error: " & ex.Message)
End Try
End Sub

Regards /snedker

Nov 21 '05 #2
that's my thought. I have seen this error in regular win apps as well
-- setting the principal policy in a windows app works if the user is
permitted to send mail; depending upon how the service runs, the
account soecified may not have sufficient privs

Nov 21 '05 #3
On Wed, 15 Jun 2005 17:39:42 +0200, "Carlos J. Quintero [.NET MVP]"
<ca*****@NOSPAM sogecable.com> wrote:

The file CDONTS.dll is not to be found on my system. However,
CDOsys.dll is. Is this a problem - and if so, how do I install
CDONTS.dll?

I'm using the SYSTEM-account to run the service. This account has
already been granted full control of the file (which is in the
System32 directory).

Regards /Snedker
It could be a credentials problem?
See if it is addressed here: http://systemwebmail.com/


Nov 21 '05 #4
> The file CDONTS.dll is not to be found on my system. However,
CDOsys.dll is. Is this a problem - and if so, how do I install
CDONTS.dll?


I think that that's explained at http://systemwebmail.com/ too.
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
Nov 21 '05 #5

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

Similar topics

9
4964
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
0
361
by: MrFez | last post by:
I have a simple .Net console program that sends an email message. The message can be specified as a string or a filename on the command line. Refer to the code below. The problem I am having is that it works fine on one computer (my workstation) for messages of any size but it fails on another computer (my test server) for messages larger than 900 bytes. Both systems are running Windows 2003 Server - Standard Edition. My workstation is...
3
2249
by: Brian Farnhill (MCP VB.NET) | last post by:
Hi, I am having some trouble using the MailMessage object to send an email with more than one attachment. I am working on a web based application where a user can submit information, along with a number of files. The information, including the file is stored in the database, and an email is sent with the information and any files that were submitted are attached. The system works fine when a user makes a submission that has no...
4
3659
by: Joe Reiss | last post by:
Hi all, I'm using the System.Net.Mail namespace to set up a SMTP sendmail. This works for the most part, however, when I try to send email to a cell phone text msg. via the Verizon 'vtext' Gateway it fails with a 550 relay error msg. I've had this problem in the past with Delphi/Indy SMTP component. The problem there was that the component was blacklisted by Verizon for previous use by spammers. The fix was to get rid of the...
2
3501
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net Framework v1.1 SP1. The code worked fine under W2K SP4.
2
2680
by: ChrisA | last post by:
I'm sending email from my ASP.NET 1.1 app, and it works fine providing the BodyFormat of the System.Web.Mail.MailMessage is set to Text. If I change to Html format, it breaks. Here's the code: Me.Msg = New System.Web.Mail.MailMessage With Me.Msg .To = "someToAddress"
0
1553
by: Neo Geshel | last post by:
I am experiencing an inconsistency with System.Net.Mail. I have a web form on a site. The form gets filled, and one copy gets sent to the recipient (info@domain.com). This works just fine. However, I want a summarized e-mail (with slightly different content) to get sent to the sender, and this fails unless the “sender”has their domain name on the same server. Essentially, it has the following problem:
0
1614
by: NowGeorge | last post by:
We execute dts packages to generate reports. We have an error using the send mail task. This is not a profile issue. It fails for the 3 users using this. Can open enterprise manager and execute the send mail task with no errors from my desktop using a local install. The dts packages require we use remote desktop connection to execute the jobs. The send mail task fails with a mapi error 273 level 16. At present the business...
4
2399
by: David C | last post by:
I would like to have an email go to 2 email addresses but when I try it by separating with semicolon or comma it fails. Can anyone help? below is my code (see ToAddress string). Thanks. David strUser = UtilClass.GetUserName(strUser) '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS Const ToAddress As String = "me@myemail.com" Const FromAddress As String = "me@myemail.com"
0
9628
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10122
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8954
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5368
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.