473,792 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send an email directly through Exchange

If there is no email client on the XP workstation that my DB is on, is it
possible for Access to talk directly with Exchange Server to send an email?

I am sure you might think, what's the problem with simply installing
Outlook. Well I guess I am looking for the "elegant" solution :O)

Thanks

Paul
Jul 5 '06 #1
9 18115
Hi Paul,

The following KB article might help:

http://support.microsoft.com/?kbid=153311

Cheers - David
Paul H wrote:
If there is no email client on the XP workstation that my DB is on, is it
possible for Access to talk directly with Exchange Server to send an email?

I am sure you might think, what's the problem with simply installing
Outlook. Well I guess I am looking for the "elegant" solution :O)

Thanks

Paul
Jul 5 '06 #2

Paul H wrote:
Well I guess I am looking for the "elegant" solution :O)
hour of pain working this one out! just substitute the [] fields and
include the Miscrosoft CDO library - no outlook profiles required:

Sub SendHTMLMail(st rTo As String, strSubject As String, strBody As
String)
'============== =============== =============== ========
'Bill Coleman
'20th April 06
'Sends email HTML email directly via exchange server, w/o outlook
'============== =============== =============== ========

Dim iCfg As CDO.Configurati on
Dim iMsg As CDO.Message

Set iCfg = New CDO.Configurati on

With iCfg
.Fields(cdoSMTP Server) = "[EXCHANGE SERVER NAME]"
.Fields(cdoSMTP ServerPort) = 25 ' typically
.Fields(cdoSend UsingMethod) = cdoSendUsingPor t
.Fields(cdoSMTP ConnectionTimeo ut) = 200
.Fields.Update
End With

Set iMsg = New CDO.Message
With iMsg
Set .Configuration = iCfg
.From = "[Name Of Sender]"
.Sender = "[Me@Whatever.com]"
.ReplyTo = "[Me@Whatever.com]"
.Subject = strSubject
.HTMLBody = strBody
.To = strTo
.Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Sub

Jul 5 '06 #3
this article explains how it works rather well:
http://www.imibo.com/delphi/mapiorcdo.html

You can use the MAPI directly if you are feeling brave, but it's far
more complicated then needs be when you have the CDO wrapper - also
most reference examples using MAPI require that there be an outlook
profile on the PC, bringing you back to square one, needing outlook.
But the code I gave (a twist on somthing from Lyle, I think) talks
directly with no profile. That way outlook isnt envoked and you dont
have to suffer those security warnings (outlook 2003+).

Jul 5 '06 #4

"BillCo" <co**********@g mail.comwrote in message
news:11******** *************@a 14g2000cwb.goog legroups.com...
>
Paul H wrote:
>Well I guess I am looking for the "elegant" solution :O)

hour of pain working this one out! just substitute the [] fields and
include the Miscrosoft CDO library - no outlook profiles required:

Sub SendHTMLMail(st rTo As String, strSubject As String, strBody As
String)
'============== =============== =============== ========
'Bill Coleman
'20th April 06
'Sends email HTML email directly via exchange server, w/o outlook
'============== =============== =============== ========

Dim iCfg As CDO.Configurati on
Dim iMsg As CDO.Message

Set iCfg = New CDO.Configurati on

With iCfg
.Fields(cdoSMTP Server) = "[EXCHANGE SERVER NAME]"
.Fields(cdoSMTP ServerPort) = 25 ' typically
.Fields(cdoSend UsingMethod) = cdoSendUsingPor t
.Fields(cdoSMTP ConnectionTimeo ut) = 200
.Fields.Update
End With

Set iMsg = New CDO.Message
With iMsg
Set .Configuration = iCfg
.From = "[Name Of Sender]"
.Sender = "[Me@Whatever.com]"
.ReplyTo = "[Me@Whatever.com]"
.Subject = strSubject
.HTMLBody = strBody
.To = strTo
.Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Sub
Many thanks for that..I feel your pain ;o)

How can check for the existence of the Exchange server? This is so that the
database can "choose" to use exchange instead of Outlook if the PC is
connected to an Exchange server.

My development PC does not connect to an Exchange server.

Thanks,

Paul
Jul 6 '06 #5
What is interesting is that with suitable amendment this works with script
as well.
--

Terry Kreft
"Paul H" <no****@nospam. comwrote in message
news:Is******** *************** *******@eclipse .net.uk...
>
"BillCo" <co**********@g mail.comwrote in message
news:11******** *************@a 14g2000cwb.goog legroups.com...

Paul H wrote:
Well I guess I am looking for the "elegant" solution :O)
hour of pain working this one out! just substitute the [] fields and
include the Miscrosoft CDO library - no outlook profiles required:

Sub SendHTMLMail(st rTo As String, strSubject As String, strBody As
String)
'============== =============== =============== ========
'Bill Coleman
'20th April 06
'Sends email HTML email directly via exchange server, w/o outlook
'============== =============== =============== ========

Dim iCfg As CDO.Configurati on
Dim iMsg As CDO.Message

Set iCfg = New CDO.Configurati on

With iCfg
.Fields(cdoSMTP Server) = "[EXCHANGE SERVER NAME]"
.Fields(cdoSMTP ServerPort) = 25 ' typically
.Fields(cdoSend UsingMethod) = cdoSendUsingPor t
.Fields(cdoSMTP ConnectionTimeo ut) = 200
.Fields.Update
End With

Set iMsg = New CDO.Message
With iMsg
Set .Configuration = iCfg
.From = "[Name Of Sender]"
.Sender = "[Me@Whatever.com]"
.ReplyTo = "[Me@Whatever.com]"
.Subject = strSubject
.HTMLBody = strBody
.To = strTo
.Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Sub

Many thanks for that..I feel your pain ;o)

How can check for the existence of the Exchange server? This is so that
the
database can "choose" to use exchange instead of Outlook if the PC is
connected to an Exchange server.

My development PC does not connect to an Exchange server.

Thanks,

Paul


Jul 6 '06 #6
Just a quickie to say thanks Bill, it worked perfectly and no Terry, I am
not a script kiddie!

Paul
Jul 12 '06 #7
I didn't imply that you were.

Having said that and with all due distaste for scrip kiddies out of the way,
there are occasions where scripting is the best tool for the job.

There was an occasion just last year where this code would have been useful
to a colleague of mine who needed to be able to e-mail alerts from a
script, also there is a customer of mine who changed server, didn't install
SMTP on the new server and then wondered why e-mail alerts from a DTS
package stopped working. I suspect that a VBScript component added to the
package with the code posted in this script could well have sorted their
problem for them.

--

Terry Kreft
"Paul H" <no****@nospam. comwrote in message
news:ba******** ************@ec lipse.net.uk...
Just a quickie to say thanks Bill, it worked perfectly and no Terry, I am
not a script kiddie!

Paul


Jul 12 '06 #8
>I didn't imply that you were.
My apologies, I misunderstood you and got paranoid about being deemed
"unclean" by the group ;o)

My mistake,

Regards,

Paul


Jul 13 '06 #9
It's all too easy to misunderstand posts.

I reckon that lack of body language has been the cause of more heated
discussions than most anything else in NGs.
--

Terry Kreft
"Paul H" <no****@nospam. comwrote in message
news:zd******** ************@ec lipse.net.uk...
>
I didn't imply that you were.

My apologies, I misunderstood you and got paranoid about being deemed
"unclean" by the group ;o)

My mistake,

Regards,

Paul


Jul 13 '06 #10

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

Similar topics

8
18530
by: Samia | last post by:
I have an application running on a single workstation (win 2000) with Outlook installed and a profile create using and exchange server with authentification through the DNS. This user profile is the only one using the app. I want the app to send email using the profile's email adress. Here is what I am doing : Dim mail As New MailMessage()
1
1798
by: Brian Henry | last post by:
Does anyone know how to send an email to an internal exchange server (internal email only, how you can send email to a username in active directory in exchange with out a domain (@domain.com) after it..) from vb.net with out useing smtp? because some exchange servers actually dont use SMTP because they are internal only... if you know what I mean, do you know how to do this from VB.net to send to an internal user? thanks! --...
9
4311
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
2
3522
by: RedEye | last post by:
Hello, I am trying to create a class to send email via POP3 or Exchange. Everything works fine when sending via POP3 but fails when sending via exchange. Error: Could not access 'CDO.Message' object. The following code works fine in a VB.Net test app but fails on the web. Does anyone have an idea why??
5
1622
by: Michal | last post by:
Hi I need to connect to Exchange 5.5 from .Net Web Application and send email using user profile. I did it two years ago on ASP but now I have to migrate it to .Net. I can not find any solutions in msdn to resolve it. Any idea how I can do this ? Michal
0
782
by: dfetrow410 | last post by:
Does anyone know of a good example to show mw how to do this?
1
2959
by: Gilbert Cheung | last post by:
Hello. I am writing a website for my company. There is a sign-up form that requires us to send a confirmation email to our customer. Our company uses Exchange Server 2000 as our mail server. We decided not to implement any smtp server as that may post some additional security risk. The question is, how can I write an ASP.NET 1.1 script (in C#, though I think there is not much difference between C# and VB.NET) that can send email,...
9
1594
by: brad | last post by:
I'd like to send email directly from within python without having to rely on an external smtp server. You know, something like the good, old Unix... echo My_message | mail -s Subject person@someplace.com Can Python do something similar in a portable fashion without a smtp server installed on the machine? Thanks,
1
1364
by: shaista | last post by:
How to send email thorugh exchange server? How to include sent emails into the sent item folder of mailbox through exchange server?
0
9670
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
10430
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...
1
10159
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
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
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
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.