473,386 Members | 1,606 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.

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(mail) 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("sendmail 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.SmtpServer = mySMTPserver
SmtpMail.Send(mail)
Catch ex As Exception
WriteLog("Email error: " & ex.Message)
End Try
End Sub

Regards /snedker
Nov 21 '05 #1
4 1585
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_spammenot_ATdbconsult.dk> escribió en el mensaje
news:dj********************************@4ax.com...
Using the procedure below on an ordinary form works fine. Moving it to
a service-project makes it fail on SmtpMail.Send(mail) 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("sendmail 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.SmtpServer = mySMTPserver
SmtpMail.Send(mail)
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*****@NOSPAMsogecable.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
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...
0
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...
3
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...
4
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'...
2
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...
2
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: ...
0
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. ...
0
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...
4
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...
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: 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...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.