Solved

How do I send mail from Ms Access Module without Outlook

Posted on 2011-02-18
12
329 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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

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)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IT Desktop Support 11 65
How can you open the FORM2 2 31
Calculation in Access 5 25
Access Open Report with SQL Parameter 11 29
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 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