Email created from application program not send if outlook not act

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a program to send alert email from my application system.
The program working fine with outook express whereby those alert emails are
able to send out from outlook express even through my server did not
activated Output Express. Recently I am look for send those alert emails by
Outlook. The program I encountered was all the alert emails will not send if
Outlook is not actived at my server. Any idea not to send out email from
Outlook when Outlook is not actived? Thank you.
 
I can not offer an answer because I am looking for an answer to the same
problem, I think. I have an Access application that activates as a scheduled
task after hours when the workstation is logged off. Part of its function is
to send an email, which it does correctly (security is looked after by
MAPIlab's Advanced Security), but the meesage never gets out of the system,
it sits in the outbox until I log in. As soon as I log in the message is
sent but it should have gone hours ago. Any suggestions on getting the
message to be SENTat the correct time would be apprciated.
 
You need in some way to activate the send/receive mechanism after you issue
a .Send command to the email. You can do that by using the Execute method of
the Send/Receive or Send/Receive All buttons and/or using DeliverNow if you
are using CDO 1.21 or Redemption (www.dimastr.com/redemption) code.

Very often you need to combine the two methods and use DeliverNow and then
execute the Send/Receive function.

Of course if Outlook has been started with no UI then the
ActiveExplorer.CommandBars collection will not have been initialized and you
couldn't call Execute on Send/Receive.
 
I found this little gem over in the Access area and it does exactly as
required.
============================
If you clients have Win 2K or Higher OS then you can use CDO (Microsoft
Collaboration Data Objects) to sent the mail.

Public Sub testCDO()
' Purpose Send an Email with or without an attachment without using
Outlook or other MAPI client
' Uses Late Binding - Does not need a reference to the Microsoft
CDO For Windows library

Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String

strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "YourMailServer.com"
'Only used if SMTP server requires Authentication
'.Item(strSch & "smtpauthenticate") = cdoBasic
'.Item(strSch & "sendusername") = "(e-mail address removed)"
'.Item(strSch & "sendpassword") = "YourPassword"
.Update
End With

Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "Ron"
.sender = "(e-mail address removed)"
.To = "(e-mail address removed)"
.Subject = "Sample CDO Message"
'.TextBody = "This is a test for CDO.message"
.HTMLBody = "this is not Bold But <B>This is!</B>"
'.AddAttachment "c:\Inv83595.pdf"
'.AddAttachment "c:\Inv83596.pdf"
'.MDNRequested = True
.Send

End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing
End Sub
===============================
 
Back
Top