Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2004, 10:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default Send mail NOT via Outlook

I have a database that send e-mails using Outlook, but I now want a way to send e-mails not using VBA to control Outlook.

Is there a way to communicate with my mail server directly?
__________________
Mitch
 
Old March 20th, 2004, 09:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You may be able to use CDONTS.NewMail. There are other new objects with Windows 2000, but I don't know those offhand.
 
Old March 21st, 2004, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've never heard of that, what is it?
 
Old March 21st, 2004, 10:08 AM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CDONTS will still require you to code

Mitch what are you trying to achieve?

If it is to control Outlook externally then you have two choices:

1. Programmatically - hence using object models like CDO (collaborative data objects which is built into Windows 2K) and Outlook. Alternatively use the SendObject method of the DoCmd object.

2. Find a utility on the web

Hope this helps
 
Old March 21st, 2004, 10:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I am trying to do is NOT use Outlook at all. As I indiacated I have allready done that (I did not give my reasons for not wanting to continue using my application to work in conjunction with Outlook because I did not want people to get off on a tangent by addressing those reasons) :)

What I want to do is from my Access database send text and HTML based e-mail messages. Can this be done some way or is going through Outlook the only way to do it?

Also, coding in VBA is not a problem for me.
 
Old March 21st, 2004, 05:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried to do something similar quite a while ago - as the job I was at used Netscape for it's email. I asked a very similar question to you - and the response was basically to do a whole heap of bulky MAPI calls - which I didn't want to do.

In the end, I used two different methods - I wrote a little script that would send email via sendmail on a UNIX web server, and just used the "mailto:[email protected]" as a hyperlink.

It never really satisfied my needs though (i.e - couldn't send attachments - had to have code to write the attatchment as text into the body of the email).

Thankfully - I'm now working at a place that uses Outlook - so I don't have to worry about that any more - which doesn't really help you at all. But I thought I'd let you know that it's not going to be easy.



I am a loud man with a very large hat. This means I am in charge
 
Old March 21st, 2004, 05:55 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,
   I hope I'm not coming into this thread to late. I just ran into the same problem and here is the code I used to solve the problem. We are running W2003 ad server, so CDONTS isn't an option. I had to use CDO instead. Here is the code. It is air code, so forgive the breaks. Replace the xxx with the IP address of your SMTP server. You will also have to setup your SMTP server to allow relaying for those machines that will run your application. You can also do attachments, but I didn't include that in my code example.

Here is the link to a similar example but it uses the pickup directory instead. It works but all your users will need access to the pickup directory. That wasn't an option in our case...security you know.
http://support.microsoft.com/default...b;EN-US;286430

Sub Testing
    Dim objCDOMail As Object
    Dim objConf As Object
    Const cdoSendUsingPort = 2

    'This procedure e-mails the comment to the developer using CDO
    Set objCDOMail = CreateObject("CDO.Message")
    Set objConf = CreateObject("CDO.Configuration")

    With objConf.Fields
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xxx.xxx.xxx.xxx"
        .Update
    End With

    With objCDOMail
        Set .configuration = objConf
        .To = "[email protected]
        .From = "[email protected]
        .bcc = "[email protected]"
        .Subject = "Testing"
        .TextBody = "This is a test"
        .Send
    End with

    Set objCDOMail = Nothing
    Set objConf = Nothing

End Sub
 
Old March 21st, 2004, 07:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dataman,

Thanks, I think that is what I was looking for.

Is the line:
  .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")

something that points to something that Microsoft provides? Or am I missunderstanding what that line does?
 
Old March 22nd, 2004, 06:17 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by Mitch
 Dataman,

Thanks, I think that is what I was looking for.

Is the line:
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")

something that points to something that Microsoft provides? Or am I missunderstanding what that line does?
As far as I know it's just the name of a property. The fact that it's also a URL is coincidental.


--

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Outlook - Send and Print Macro Karen Long VB How-To 0 June 14th, 2005 03:19 AM
How to send an Outlook mail item to a URL haiying Access VBA 0 April 29th, 2005 08:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.