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

Microsoft Access Not Sending E-Mails

I wrote a program in microsoft access to send a report via e-mail. The
e-mail works great when I run the computer from a session on my
server. However, when I auto schedule the job to run the access
program fails to send the e-mail. When I check the logs of the server
I get DCOM errors. Does anybody know how to fix this problem? Here's a
copy of the program.

Private Sub YouveGotMail()

Dim TheMessage As String

TheMessage = "Active Requests As Of " & _
FormatDateTime( Now(), vbgeneraldate)

Dim objMailDim As Object

Set objMail = Outlook.CreateObject(CDONTS.NewMail)
objMail.To = "ak***@chw.edu"
objMail.From = "ak***@chw.edu"
objMail.Subject = TheMessage
objMail.Body = TheMessage
objMail.Attach = "T:\New Folder\Remedy Data\ActiveTasks.xls"
objMail.Send

End Function
My references include IIS New Mail and Microsoft Outlook.

Any help would be appreciated.

Thank you.
Nov 13 '05 #1
2 1879
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm not sure about the statement:

Set objMail = Outlook.CreateObject(CDONTS.NewMail)

"Outlook" before the CreateObject() function is unknown to me, and, the
ActiveX object name should be delimited by double-quotes. E.g.:

Set objMail = CreateObject("CDONTS.NewMail")

=====

About automatically running an Access program from a server: through
research I've found that the Access program has to run in a separate
user's process. IOW, the user logon session has to be running on the
server & then the Access program is automatically run by that user logon
session. I didn't understand what that meant, nor how to implement it,
so I decided to have a [human] user "manually" run the program (only
once a month).

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQX397oechKqOuFEgEQLLBQCfXgk0YYegz0C+UcVaIKBZAg fG+mcAn3Ls
AaJcdyr6A4FQVaErgo7iF4K7
=JKOi
-----END PGP SIGNATURE-----
Aharon Koss wrote:
I wrote a program in microsoft access to send a report via e-mail. The
e-mail works great when I run the computer from a session on my
server. However, when I auto schedule the job to run the access
program fails to send the e-mail. When I check the logs of the server
I get DCOM errors. Does anybody know how to fix this problem? Here's a
copy of the program.

Private Sub YouveGotMail()

Dim TheMessage As String

TheMessage = "Active Requests As Of " & _
FormatDateTime( Now(), vbgeneraldate)

Dim objMailDim As Object

Set objMail = Outlook.CreateObject(CDONTS.NewMail)
objMail.To = "ak***@chw.edu"
objMail.From = "ak***@chw.edu"
objMail.Subject = TheMessage
objMail.Body = TheMessage
objMail.Attach = "T:\New Folder\Remedy Data\ActiveTasks.xls"
objMail.Send

End Function
My references include IIS New Mail and Microsoft Outlook.


Nov 13 '05 #2
ak***@chw.edu (Aharon Koss) wrote in message news:<a3**************************@posting.google. com>...
I wrote a program in microsoft access to send a report via e-mail. The
e-mail works great when I run the computer from a session on my
server. However, when I auto schedule the job to run the access
program fails to send the e-mail. When I check the logs of the server
I get DCOM errors. Does anybody know how to fix this problem? Here's a
copy of the program.

Private Sub YouveGotMail()

Dim TheMessage As String

TheMessage = "Active Requests As Of " & _
FormatDateTime( Now(), vbgeneraldate)

Dim objMailDim As Object

Set objMail = Outlook.CreateObject(CDONTS.NewMail)
objMail.To = "ak***@chw.edu"
objMail.From = "ak***@chw.edu"
objMail.Subject = TheMessage
objMail.Body = TheMessage
objMail.Attach = "T:\New Folder\Remedy Data\ActiveTasks.xls"
objMail.Send

End Function
My references include IIS New Mail and Microsoft Outlook.

You don't need the Outlook reference at all. You need the CDONTS
library registered. It should read something like

set objMail = CONTS.NewMail
Nov 13 '05 #3

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

Similar topics

10
by: MLH | last post by:
I print to a device that creates a PDF. Knowing the filename, how can I then embed the PDF into the body text of an OutLook Express outbound email & send to a specified address in a table? I want...
10
by: Bob Darlington | last post by:
I have been getting the above error message intermittently when I open any one of five or six forms in design view, change some control formatting (like backcolor) and try to open the form in form...
71
by: Lauren Wilson | last post by:
Hello folks, Would love yo get all informed opinions and/or facts on the following: Over the last few weeks I have spent quite a bit of time reviewing all the Access and .NET stuff I could...
7
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
2
by: thechaosengine | last post by:
Hi eveyone, If anyone could advise on the following I would be truly greatful: I have a fairly standard set up. An IIS 5.1 website set up with anonymous access allowed in all areas of the site...
62
by: Ecohouse | last post by:
I was just wondering if there was any way to use a toolbar in Outlook 2002 in Access 2002? I want to create a custom toolbar in Access similar to the Calendar toolbar in Outlook. Any ideas?
0
by: Alan | last post by:
Hello World: I'm trying to build an application (using Access 2003) that will allow users who have to perform tasks in a particular order, to notify the next person in line when their task is...
0
by: Steve_s | last post by:
Hi I included a Microsoft Chart on the main form of my access 2000 database. I included the chart using Access 2003 on my pc at home, however when I open the database on my pc at work using...
5
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying...
2
by: Jodye Roebuck | last post by:
I have a program that's been automatically generating and sending emails flawlessly. My clients workstation had an automatic Microsoft security update done on it.. and now it's bombing on this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.