[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do I send mail from Ms Access Module without Outlook

Posted on 2011-02-18
12
Medium Priority
?
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 58
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
 
LVL 58
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 46

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 58
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 58
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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