473,655 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple email from access

I have searched through the posts for a question like mine but have
only found much more complicated responses.

On single record view of a form I have an email address field. I
merely want to create a button that will email the same message (and
idealy a word attachment) to whatever address is in view on the form
(chances are that I just input it).

For further explanation:

I am systematically going throug a list of prospects and view them one
at at time on the form. When I contact someone who agrees to allow me
to send them a mail, I want to just push the button and away it goes
(a couple dialog boxes in the mean time are OK).

The mail would have a fixed subject like "I'll call you later". The
message would have a brief explanation of my services suggesting they
open the word attachment for a prettier and more detailed explanation.
If the word attachment complicates things too much I can use another
format such as an access report.

I have some of the components in place now and it seems to be working
but the tests I have done are still in the outbox of outlook. I use
outlook express exclusively for my mail now. Will I have to change
that somewhere and if so where and how.

Thanks,

Bill
Nov 13 '05 #1
19 2782
Pat
Bill,
Tony Toews has a great FAQ on email that should give you some options. My
personal favorite is CDONTS, since it's so simple.
http://www.granite.ab.ca/access/email.htm
Pat

"Bill" <bb***@iquest.n et> wrote in message
news:7f******** *************** ***@posting.goo gle.com...
I have searched through the posts for a question like mine but have
only found much more complicated responses.

On single record view of a form I have an email address field. I
merely want to create a button that will email the same message (and
idealy a word attachment) to whatever address is in view on the form
(chances are that I just input it).

For further explanation:

I am systematically going throug a list of prospects and view them one
at at time on the form. When I contact someone who agrees to allow me
to send them a mail, I want to just push the button and away it goes
(a couple dialog boxes in the mean time are OK).

The mail would have a fixed subject like "I'll call you later". The
message would have a brief explanation of my services suggesting they
open the word attachment for a prettier and more detailed explanation.
If the word attachment complicates things too much I can use another
format such as an access report.

I have some of the components in place now and it seems to be working
but the tests I have done are still in the outbox of outlook. I use
outlook express exclusively for my mail now. Will I have to change
that somewhere and if so where and how.

Thanks,

Bill

Nov 13 '05 #2
Lyle Fairfield just posted code that sends mail through Outlook
Express. Check the last few days of postings.
Nov 13 '05 #3
Use SendObject to pickup the email address from the form, and you can
specify the subject line and body text, but probalby not the attachment.

If you need something more, see Tony Toews' Access Email FAQ at:
http://www.granite.ab.ca/access/email.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Bill" <bb***@iquest.n et> wrote in message
news:7f******** *************** ***@posting.goo gle.com...
I have searched through the posts for a question like mine but have
only found much more complicated responses.

On single record view of a form I have an email address field. I
merely want to create a button that will email the same message (and
idealy a word attachment) to whatever address is in view on the form
(chances are that I just input it).

For further explanation:

I am systematically going throug a list of prospects and view them one
at at time on the form. When I contact someone who agrees to allow me
to send them a mail, I want to just push the button and away it goes
(a couple dialog boxes in the mean time are OK).

The mail would have a fixed subject like "I'll call you later". The
message would have a brief explanation of my services suggesting they
open the word attachment for a prettier and more detailed explanation.
If the word attachment complicates things too much I can use another
format such as an access report.

I have some of the components in place now and it seems to be working
but the tests I have done are still in the outbox of outlook. I use
outlook express exclusively for my mail now. Will I have to change
that somewhere and if so where and how.

Thanks,

Bill

Nov 13 '05 #4
Please note that there are several problems with Lyle's code for apps that
need to support more than English, including the hard-coded path to Outlook
Express that assumes the English directory name for "Program Files" and the
improper use of Unicode conversion (converting the Unicode VBA strings to
"double Unicode") which causes the code to fail on CJK platforms.

There is a link to it from somewhere off of Tony's site at
http://www.granite.ab.ca/access/email.htm I believe.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.
"Pieter Linden" <pi********@hot mail.com> wrote in message
news:bf******** *************** *@posting.googl e.com...
Lyle Fairfield just posted code that sends mail through Outlook
Express. Check the last few days of postings.

Nov 13 '05 #5
Please try to overcome your disgust and accept my appologies for my
ignorance.

I copied and pasted the cdonts code (of course I removed the bullets
beginning each line) into the event on my form and it is balking. Is
this where it was supposed to go. I checked access help and it doesn't
seem to recognize cdonts.

Where was this code supposed to go?
Bill
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #6
"Pat" <no*****@ihates pam.bum> wrote in
news:_V******** *********@fe1.t exas.rr.com:
Tony Toews has a great FAQ on email that should give you some
options. My personal favorite is CDONTS, since it's so simple.
http://www.granite.ab.ca/access/email.htm


Keep in mind, though, that if the machine you're sending it from
does not have a fixed IP address, any recipient whose ISP is using
one of the real-time black holes that includes all dynamic IP host
addresses will likely classify your messages as spam, and may even
simply reject the email entirely.

You many never know if your email message failed to get to the
recipient.

Perhaps it's possible to control CDONTS in a fashion that you can
specify your ISP's SMTP server as the only relay it uses, and
perhaps you can have CDONTS authenticate on that SMTP server. If
that's the case, that would be a safe and reliable method for
sending email.

However, I don't seen any SMTP service on my Win2K workstation, and
Tony's code fails to work (even after I fix the errors in it, where
it lacks "=" for setting properties).

It doesn't seem as though there's any way to control the SMTP server
it connects to, I see now that I have tested it, so it probably
isn't really usable after all.

Most of my clients are happy with SENDOBJECT, because their SENT
MESSAGES folder in their email client then has a copy of the mail
they send out. SENDOBJECT also uses your default email client's SMTP
settings, so it's not going to generate messages that are likely to
get rejected as spam.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #7
Pat
William,
You will need to be on an NT-based machine (NT/2K,XP) and have the reference
for CDO Library checked. (see Allen Brown's site for more info on
references - http://members.iinet.net.au/~allenbrowne/ser-38.html).

You can place the code in the form module or in a separate module with the
control event referencing the function.
Hope this gets you started.
Pat
"William Hepburn" <bb***@iquest.n et> wrote in message
news:40******** **************@ news.newsgroups .ws...
Please try to overcome your disgust and accept my appologies for my
ignorance.

I copied and pasted the cdonts code (of course I removed the bullets
beginning each line) into the event on my form and it is balking. Is
this where it was supposed to go. I checked access help and it doesn't
seem to recognize cdonts.

Where was this code supposed to go?
Bill
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #8
Pat
David,
You are absolutely right about the blackholes listings - this could indeed
be a problem with the CDONTS function on Tony's site. I've actually had
great success however with another function using the CDO library:

Sub SendEmail()
Const MailSender as String = "sender @ yourdomain.com"
Const MailRecipient as String = "recipient @ anotherdomain.c om"
Const MailCCRecipient as String = "cc @ anotherdomain.c om"
Const MailSubject as String = "Here's an email with an attachment"
Const MailBody as Strnig = "See the attachment"

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configurati on
Dim Flds as New CDO.Fields
Dim strAttachment as String

strAttachment = "C:\somefile.tx t"

With Flds
.Item(cdoSMTPSe rver) = "ip address or name of smtp server"
.Item(cdoSMTPSe rverPort) = 25 ' typically
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPCo nnectionTimeout ) = 200
.Item(cdoSMTPAu thenticate) = cdoNTLM
End With

With iMsg
Set .Configuration = iConf
.To = MailRecipient
.CC = MailCCRecipient
.From = MailSender
.Subject = MailSubject
.TextBody = MailBody
.AddAttachment (strAttachment)
.MDNRequested = True 'return receipt on
.Send
End With

End Sub

This routine does allow you to specify the IP address (or UNC) for a valid
SMTP server - just make sure it's accepting mail relay from your IP! You'll
notice a method for CDO.Fields that allows for authentication. This
function has an extra flair in that you can set a flag for return receipt,
but we all now how easily a recipient can block that. However, you will
have to have SMTP Service configured on the machine running the routine -
just add the service and have your windows setup CD handy - you'll basically
be installing the IIS component.

Hope this works for you. I've found it to be a nice work around to avoid
patching Outlook so as not to get the security warnings. Curious to hear if
you have other problems or reservations about this routine.
Pat

"David W. Fenton" <dX********@bwa y.net.invalid> wrote in message
news:Xn******** *************** ***********@24. 168.128.86...
"Pat" <no*****@ihates pam.bum> wrote in
news:_V******** *********@fe1.t exas.rr.com:
Tony Toews has a great FAQ on email that should give you some
options. My personal favorite is CDONTS, since it's so simple.
http://www.granite.ab.ca/access/email.htm


Keep in mind, though, that if the machine you're sending it from
does not have a fixed IP address, any recipient whose ISP is using
one of the real-time black holes that includes all dynamic IP host
addresses will likely classify your messages as spam, and may even
simply reject the email entirely.

You many never know if your email message failed to get to the
recipient.

Perhaps it's possible to control CDONTS in a fashion that you can
specify your ISP's SMTP server as the only relay it uses, and
perhaps you can have CDONTS authenticate on that SMTP server. If
that's the case, that would be a safe and reliable method for
sending email.

However, I don't seen any SMTP service on my Win2K workstation, and
Tony's code fails to work (even after I fix the errors in it, where
it lacks "=" for setting properties).

It doesn't seem as though there's any way to control the SMTP server
it connects to, I see now that I have tested it, so it probably
isn't really usable after all.

Most of my clients are happy with SENDOBJECT, because their SENT
MESSAGES folder in their email client then has a copy of the mail
they send out. SENDOBJECT also uses your default email client's SMTP
settings, so it's not going to generate messages that are likely to
get rejected as spam.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Nov 13 '05 #9
"Pat" <no*****@ihates pam.bum> wrote in
news:i7******** **********@fe2. texas.rr.com:
This routine does allow you to specify the IP address (or UNC) for
a valid SMTP server - just make sure it's accepting mail relay
from your IP! You'll notice a method for CDO.Fields that allows
for authentication. This function has an extra flair in that you
can set a flag for return receipt, but we all now how easily a
recipient can block that. However, you will have to have SMTP
Service configured on the machine running the routine - just add
the service and have your windows setup CD handy - you'll
basically be installing the IIS component.


Well, it's good to know that it's doable, but having to install IIS
means it's basically unusable -- IIS is so full of security holes
that you really don't want it running on any machine, server or
workstation.

It's too bad MS makes these things so monolithic. There's no reason
that a local SMTP server should be dependent on an HTTP server.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1726
by: Dynamo | last post by:
Hi I have used the following script within a simple form email to prevent the form being used from an external url. <?php $referer = $_SERVER; // Get the URL of this page $myurl= "http://".$_SERVER.$_SERVER; // If the referring URL and the URL of this page don't match then // display a message and don't send the email.
1
2031
by: Howie | last post by:
Hi, i need a simple multiuser access to a file for parameters like increment numbers. The numbers are needed for order-numbers etc. They should be incremented by every programm (client) on an simple LAN server. How can i do this ?
14
3095
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
3
1389
by: Unknown | last post by:
Hello i am new to C# and am having trouble with variable access.. What I am doing is just making a timer, and within the tick event I want a variable to increase a number.. for example tick event: integervar++; end event
4
2989
by: learnfpga | last post by:
I am trying to write a simple code for bit maniipulation and to start with wrote a little code to read the port A of a microcontroller MPC8xx. Its running on VxWorks. Anyways thats probably irrelevant. Can anyone please point out mistake in the code.? #include <stdio.h> #include <iostream.h> #include "arch/ppc/vxPpcLib.h" unsigned long ppc_base_addr = vxImmrGet(); //Get the base address
1
12009
by: Bart Van der Donck | last post by:
Hello, In my application, I'm having a directory with a bunch of .eml files. It was my intention to read out with PHP this directory, make a list of it and show them as .eml links in the browser where the user could click on, which then opens into the default email client on the computer. It appears to be problematic to open .eml files from web into email
3
1429
by: mturner64 | last post by:
I'm working on a simple web app to send email. Below is my code: Imports System.Net.Mail Partial Class _Default Inherits System.Web.UI.Page Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubmitButton.Click Dim FromAddress As String = "mturner64@student.se.edu"
6
1794
by: migi | last post by:
Hi! I'm newbie with ASP and I have a simple task to do. I should send email using IIS. So I created html-file, which calls asp.page: <html> <form action="test.asp" method="POST"> <input type="submit" VALUE="Send"> </Form> </html> The asp-page is another simple example, test.asp:
3
1637
by: civettina | last post by:
Hi, I'm trying to send an email to' sample@sample.com' when a new row on my table contactform_con is inserted. Basically, when a person fills out the contact form (contactform_con) I want one email to go to one person to let them know. I've tried doing this using both navicat and PHPMyAdmin, but I've had no success. I've tried using EXEC xp_sendmail, but I'm not even sure if I have that as a stored procedure, or if I do need to. ...
0
8380
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
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 we have to send another system

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.