[AccessD] OT SMTP Local Server

MartyConnelly martyconnelly at shaw.ca
Thu Jun 8 12:30:15 CDT 2006


Here is another email method. I am not sure of all of the ramifications 
of this method.
China may not allow email relays.

'The example code is using CDOSYS (CDO for Windows 2000 or XP).
'I dont think I would want to go back to CDONTS for earlier systems
'It does not depend on MAPI or CDO or Outlook
'It does not use your mailbox to send email.
' So you can send mail without a mail program or mail account
' This code builds the message and drops it into a pickup directory,
' and the SMTP service running on the machine
' picks it up and send it out to the internet.

'So why use CDO code instead of Outlook automation or 
Application.SendMail in VBA.
' It doesn't matter what Mail program you are using (It uses the SMTP 
server).
' It doesn't matter what Office version you are using.
' supposedly you can send an object or file in the body of the mail 
(some mail programs can't do this)
' haven't verified this
' You can send any file attachment you like.
' No Outlook Security warning so no need for Redemption

' You probably wont have your mail server full expanded smtp address
'If you go into netscape mail or outlook and look for the smtp name
'It will look like mine, "shawmail" or "shawnews" this dns resolves
'to "shawmail.cg.shawcable.net" CDO doesn't resolve this short name so
'The quickest way to get this actual address without using registry et al.
'is run cmd and ping "shawmail" to return full qualified smtp address.
'This code wont run exactly unless you are on cable and signed on in the 
Shaw domain

Sub SendCDO()
' This example use late binding of CDOSys, you don't have to set a reference
' You must be online to net when you run the sub
' You must be running WinXP or Win2000
Dim cdoMessage As Object
Dim objCDOMail As Object
Dim strschema As String
On Error GoTo ErrorHandler ' Enable error-handling routine.
'
Set cdoMessage = CreateObject("CDO.Message")
Set objCDOMail = CreateObject("CDO.Configuration")
strschema = "http://schemas.microsoft.com/cdo/configuration/"
objCDOMail.Load -1 ' CDO Source Default
'If you have illegal or wrong smtp address here it will run for 30-60 
seconds and finally give transport error
With objCDOMail.Fields
.Item(strschema & "sendusing") = 2 ' cdoSendUsingPort
.Item(strschema & "smtpserver") = "shawmail.cg.shawcable.net" ' "Your 
SMTP server address here"
.Item(strschema & "smtpserverport") = 25 'specify port number
.Update
End With

With cdoMessage
Set .Configuration = objCDOMail
.to = "martyconn at gmail.com"
.From = "Winnie The Pooh <martyconn at shaw.ca>"
.CC = ""
.BCC = ""
.Subject = "This is another test from marty"
.TextBody = "This is the text in the body just cdo defaults"
.AddAttachment "C:\temp2\rptSampleCount.rtf"
.AddAttachment "C:\temp2\frontimage.jpeg"
.send
End With

Set cdoMessage = Nothing
Set objCDOMail = Nothing
Exit Sub ' Exit to avoid handler.
ErrorHandler: ' Error-handling routine.
Debug.Print Err.Number & "-" & Err.Description
Set cdoMessage = Nothing
Set objCDOMail = Nothing
Exit Sub
End Sub

Gustav Brock wrote:

>Hi Borge
>
>If you are running the SMTP Service of Windows (from the IIS install) you should be able to turn on logging and study.
>Still, I would run Popcorn (create a folder for each account you need to test. Copy the exe to every folder), adjust the settings, test, and study the log.
>If Popcorn works, the SMTP service is somehow misconfigured; you may simply need to increase the time out setting of this.
>
>/gustav
>
>  
>
>>>>pcs at azizaz.com 08-06-2006 18:31 >>>
>>>>        
>>>>
>Gustav,
>
> 1) C:\>telnet dommail.onthenet.com.au 25  works OK
> 2) telnet call to 127.0.0.1 25 works OK as well.
>
> So  with that, can we conclude that the ISP that I'm connecting  through here
>in Shanghai allows for communication through port 25 and that the problem issue
>is with my laptop and local smtp setup?
>
>Also, thanks John and Jim for your suggestions.
>Had a look at www.dnsexit.com but their smtp server requires authentication -
>does not work with TAE (FMS will add this functionality in future release).
>So far I've been able to use my 'home' isp smtp by using their port 9025 - but
>this works only with my outlook express as my home isp smtp requires
>authentication. For the Access application with TAE we need an smtp server with
>'open' relay, i.e. no authentication required. Hence the need for testing out
>using the local smtp server on my local pc - using port 25 .... but the problem
>here is the emails wont leave the queue folder of the local smtp server......
>why?
>regards
>borge
>
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada




More information about the AccessD mailing list