• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

How do I send mail from Ms Access Module without Outlook

in ms access i have a module like this;

‘Recipient1
DoCmd.OpenReport "ReportName", acViewPreview, "", "[QueryName]![Fieldname]="" Recipient1"""
DoCmd.SendObject acReport, "ReportName", "MicrosoftExcelBiff8(*.xls)", "a@com", "b@com ", "", "Subject", "Message body", False, ""
DoCmd.Close acReport, "ReportName"

this module repeat till how much recipient i desire. so i run this code whit a macro. i want to run this code bypassing oulook. i have dowloaded cdomail databse. i could send a trial message from there. but dont know how to adapted to the code above.
0
umitkilinc
Asked:
umitkilinc
  • 5
  • 3
  • 2
  • +1
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<< i could send a trial message from there. but dont know how to adapted to the code above. >>

  You first need to create the report in some type of output format and save it on disk. You would do this with the output to method in VBA.  For example:

          ' Export the selected Report to SnapShot format
200    DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
                         strPathandFileName


  Then use the CDO or other SMTP software to send the e-mail message with an attachment.

JimD.
0
 
umitkilincAuthor Commented:
the code i have writen just a modal. i sent for example 100 different mail with that code. so saving on disk not pratic for me.
0
 
Jim P.Commented:
Try taking a look at the code in this Q:
http://www.experts-exchange.com/Q_23257730.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<the code i have writen just a modal. i sent for example 100 different mail with that code. so saving on disk not pratic for me. >>

  Sorry, but you need to save a report in some format on disk to send it as an attachment with the CDO code.

  And there is nothing saying that you can't reuse the same disk file for each send, so the disk space required would be minimal.

JimD.
0
 
umitkilincAuthor Commented:
i think i could not explain myself celaerly. with send object, i can send different mail from a table or query bu choosing a uniq field. and to the different recipient. there is no problem. i just wanna know if i can use sent this mails bypassing outlook.

saving on disk not proper for me.
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<i think i could not explain myself celaerly. with send object, i can send different mail from a table or query bu choosing a uniq field. and to the different recipient. there is no problem. i just wanna know if i can use sent this mails bypassing outlook. >>

  You can do the same thing with a report.

<<saving on disk not proper for me. >>

You only have a few choices in sending e-mail.  If you cannot do it with Sendobject command, then you need to use:

1. Outlook
2. Mapi
3. CDO
4. Direct to SMTP server

  All those methods require saving the output to disk first, then sending as an attachment.  You cannot do it any other way.

JimD.
0
 
aikimarkCommented:
Why would saving each report to disk not be practical?

What email system are you using?
0
 
umitkilincAuthor Commented:
i meant i wanna send those reports by one step. so if it could be by saving on disk and send them one step no problem.

by sending outlook cause annoying security issue. i use clickyes command. it makes operation slowdown.
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
You can use Redemption to get around the Outlook security issues if that is your only problem:

http://www.dimastr.com/redemption/

  Otherwise, you can use one of the other methods, and yes they would all be automatic and "one step" for all practical purposes.

JimD.
0
 
Jim P.Commented:
JimD.,

I have had issues -- minor -- with redemption and how it interacts with the registry, and other apps.

umitkilinc,

Have you looked at the code in http://www.experts-exchange.com/Q_23257730.html ?
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<JimD.,

I have had issues -- minor -- with redemption and how it interacts with the registry, and other apps.
>>

  Nice to know.  I don't use it myself.  I use vbSendMail for all my apps and talk directly to the SMTP sever.  Never know if a user will have Outlook, Outlook Express, or something else.   Even CDO can be problematic (although not as much as it once was).

  But sending directly to a SMTP server is as simple as it gets with sending mail.

JimD.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now