[AccessD] Sending Email via Code

Lonnie Johnson prodevmg at yahoo.com
Tue Nov 29 12:32:16 CST 2005


Thanks guys. I actually ended using the sendmail method of the .ActiveWorkbook object. I was able to use this and have the excel sheet send itself to who I wanted to.

Gustav Brock <Gustav at cactus.dk> wrote:  Hi Lonnie

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



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



/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.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us





 





		
---------------------------------
 Yahoo! DSL Something to write home about. Just $16.99/mo. or less


More information about the AccessD mailing list