[AccessD] email from outlook

Stuart McLachlan stuart at lexacorp.com.pg
Sun Jun 18 22:45:43 CDT 2006


On 18 Jun 2006 at 23:00, JWColby wrote:

> 
> >If you want to send using the email client, then a simple call to
> DocmdSendObject will do it.
> 
> I just tried this:
> 
> docmd.SendObject ,,,"jwcolby at colbyconsulting.com",,,"test sending an
> email","This is a drill, this is a drill"
> 
> And all it did was open an outlook email, place the parameters in
> various places, and wait.  Not exactly "automatic". 

That's because you had the Edit flag missing and it defaults to True.
Try

docmd.SendObject ,,,"jwcolby at colbyconsulting.com",,,"test sending an
email","This is a drill, this is a drill",False

>  Likewise, as far
> as I can tell no way to add an attachment unless the attachment is an
> Access object. 

That is correct. 
> There are many instances where the attachment needs to
> be a text log file from the disk, an Excel or Word or PDF document
> etc.

That's why I wrote my MAPISend utility.  You can download it from 
http://www.lexacorp.com.pg if you want to try it.   Unfortunately it is a non-Access solution 
which requires the executable to be accessible to the user, so it probably wouldn't be 
appropriate for you framework.

> 
> I need: A piece of code, written in Access VBA, that will send an
> email message, complete with an attachment, regardless of where the
> Access Application is installed, regardless of what email client the
> application or computer user normally uses.  It must NOT require
> installation of a DLL, knowledge of a specific email client, calls to
> methods of a specific email client, reference to a library (unless
> that library is ALWAYS available on EVERY Windows computer).
> 

In that case, you will need something written using calls to the Winsock API to send directly 
to an SMTP server.   A  google for "VB WInsock SMTP" will give you a number of examples 
to get you started on building your own.








More information about the AccessD mailing list