[AccessD] Sending Email via Code

Gustav Brock Gustav at cactus.dk
Tue Nov 29 04:54:16 CST 2005


Hi Lonnie

If the machines run WinXP the cdoex.dll is present. That will do:

<code>

Public Sub SendCdoMsg()

  Dim msg As New CDO.Message

  With msg
    With .Configuration.Fields
      .Item(cdoSMTPAuthenticate) = cdoAnonymous
      .Item(cdoSendUsingMethod) = cdoSendUsingPort
      .Item(cdoSMTPServer) = "smtp.yourisp.com"
      .Item(cdoSMTPConnectionTimeout) = 10
      .Item(cdoSMTPServerPort) = 25
      .Update
    End With
    .Organization = "yourcompany.com"
    .To = "someone at example.org"
    .Subject = "Example subject"
    .TextBody = "Example body"
    .From = "you at yourcompany.com"
    .Send
  End With
    
  Set msg = Nothing
    
End Sub

</code>

/gustav

>>> prodevmg at yahoo.com 29-11-2005 05:14:16 >>>
Is there a way to send email via code without invoking outlook?

I have an application that may run on a machine with outlook and it may run on a machine with groupwise. I need something more generic than the Create Outlook Object process.





More information about the AccessD mailing list