473,499 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I send an email in VBA

31 New Member
I want to automate the sending of an email in Access 2007, this email will also carry an attachment of PDF or word document...or instead of that automate the sending of a report to an email address...

can you please help..I need it badly...
Aug 4 '09 #1
5 9722
Echidna
53 New Member
Hi Totomlas,

Sending a report from Access is relatively simple, if you want to send an email with an attachment, you will need to code the function calls to your email application.

if you want to send a report to an email address:

Expand|Select|Wrap|Line Numbers
  1. docmd.SendObject acSendReport, rpttest, acformatPDF,
  2. email@domain.com, ccemail, bccemail, subject,Email message,
  3. <Edit message True/False>
  4.  
if you want to send report as PDF, you will need to install the addon from microsoft.
goto www.microsoft.com and search for the following
SaveAsPDFandXPS.exe

Edit message set to False will not allow the message to be altered before your default email application sends off the mail, if set to true, the email application will prompt for you to send the mail.

hope this helps

Leon
Aug 4 '09 #2
totomalas
31 New Member
thanks for the code you provided this is exactly what i am looking for...but I have a question......where shall i put the SMTP/POP3 details so the application can actually connect to the internet and send the email?
Aug 4 '09 #3
Echidna
53 New Member
As far as I know, MS access does not have an inbuilt Email service (as SQL server does with SQL mail)
the code will place a message into your default email application's outbox, ie Outlook (Express), Thunderbird, Groupwise etc

Cheers

Leon
Aug 5 '09 #4
totomalas
31 New Member
I am tryin the method you mentioned, but I keep getting an error...it says "Microsot Access Cannot send this message" ... :(.. I dont seem to be able to solve it,, please help....
Aug 8 '09 #5
Echidna
53 New Member
Do you have an email application (Thunderbird, Outlook etc) on the machine you are using the Access app on?

Cheers

Leon
Aug 10 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
12036
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
11779
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
0
3671
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
9
4291
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
4535
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
9100
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
8
7260
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
9
77405
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
2
5619
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
2144
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.