Access to Send Via SMTP

gbird1985

New member
Local time
Today, 14:35
Joined
Sep 23, 2015
Messages
1
I have the following basic Send Object Macro.

Function McrSnapshotCallData()
On Error GoTo McrSnapshotCallData_Err

DoCmd.SendObject acQuery, "Qry_SnapShot", "Excel97- Excel2003Workbook(*.xls)", "xxx@xxx.com", "", "", "Calls", "Please find attached", False, ""


McrSnapshotCallData_Exit:
Exit Function

McrSnapshotCallData_Err:
MsgBox Error$
Resume McrSnapshotCallData_Exit

End Function

I need to be able to send run this macro on a server using a scheduler enabling an email to be sent out.

Currently this requires and outlook account on the server and it does not have one. Is it possible to include SMTP server details so this can be run automatically without me having to log on every night and send this.

Please can you me help adjust this if possible.

Sorry I am not very good with VBA stuff. Thanks
 
Currently this requires and outlook account on the server

Not so. SendObject requires a "MAPI-compliant client" installed on wherever the code is running - this can be outlook or a free mail client like Thunderbird, AND a mail account on the SMTP server.
 
Look at CDO, which does allow you to specify the SMTP server and credentials.
 
Probably good enough to copy/paste code and change appropriate values. ;)
 

Users who are viewing this thread

Back
Top Bottom