Solved

How do I send mail from Ms Access Module without Outlook

Posted on 2011-02-18
12
326 Views
Last Modified: 2012-05-11
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
Comment
Question by:umitkilinc
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 34932952
<< 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
 

Author Comment

by:umitkilinc
ID: 34933336
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
 
LVL 38

Expert Comment

by:Jim P.
ID: 34935486
Try taking a look at the code in this Q:
http://www.experts-exchange.com/Q_23257730.html
0
 
LVL 57
ID: 34939439
<<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
 

Author Comment

by:umitkilinc
ID: 34941930
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 57
ID: 34941987
<<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
 
LVL 45

Expert Comment

by:aikimark
ID: 34942174
Why would saving each report to disk not be practical?

What email system are you using?
0
 

Author Comment

by:umitkilinc
ID: 34949265
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
 
LVL 57
ID: 34953220
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
 
LVL 38

Expert Comment

by:Jim P.
ID: 34958050
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
 
LVL 57
ID: 34969876
<<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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now