Further to my last post, just to let you know I have set this up and it
works a dream. I can see that it will bypass Outlook and Exchange,
which is very useful.
Thanks very much for your help
Ondine
Ralph wrote:
> Try using CDO. Something like
>
> Dim imsg as CDO.Message
> Dim iConf as CDO.Configuration
> Dim flds as ADODB.Fields
>
> Set iConf=imsg.configuration
>
> Set Flds = iConf.Fields
> Flds(cdoURLProxyServer) = "something.server.com:8080"
> Flds(cdoURLProxyBypass) = "<local>"
> Flds(cdoURLGetLatestVersion) = True
> Flds(cdoSendUsingMethod) = cdoSendUsingPort
> Flds(cdoSMTPServer) = "mymail"
> Flds.Update
>
> With iMsg
> Set .Configuration = iConf
> .CreateMHTMLBody (eAddress), cdoSuppressNone
> .To ="(E-Mail Removed)"
> .From = "eFrom"
> .Subject = "some subject"
> .Send
> End With
>
> "Ondine" wrote:
>
> > Hi
> >
> > I was wondering if it is possible to specify an SMTP account/service when
> > automating mail through Outlook using Access 2000. Most mail will be sent
> > via the default Microsoft Exchange server, but there are certain emails which
> > need to be routed through internet mail. I am using the standard code:
> >
> > Function SendMessage(stAddr As String, stSubj As String, stBody As String,
> > Optional stCC As String, Optional stBCC As String, Optional AttachmentPath As
> > String) As Boolean
> >
> > Set objOutlook = CreateObject("Outlook.Application")
> >
> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
> >
> > With objOutlookMsg
> >
> > Set objOutlookRecip = .Recipients.Add(stRec)
> > objOutlookRecip.type = olTo
> >
> > Set objOutlookAttach = .Attachments.Add(stPath)
> >
> > ......(etc)
> > .Send
> > End with
> >
> > I can't see any place to specify the SMTP server - any ideas?
> >
> > Many thanks.
> >
> >
> >
|