By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

how do u send an email using access?

P: n/a
DP
hi,

is there a way to send an e-mail to a customer, using ms access?? or some
kind of automated mail merge, so the user only has to review the body, and
click send?

ive got a customer table, with a field called email address, where the
customer can have an e mail address.

is there a way to make access create one, using outlook express, or anything
similar??
i just wanted to create some kind of reminder e mail, to say, please bring
yor rented film back to the store.

does any1 know of any sites, advice?

TIA

dev
Feb 18 '06 #1
Share this Question
Share on Google+
17 Replies


P: n/a
On Sat, 18 Feb 2006 17:49:55 GMT, DP wrote:
hi,

is there a way to send an e-mail to a customer, using ms access?? or some
kind of automated mail merge, so the user only has to review the body, and
click send?

ive got a customer table, with a field called email address, where the
customer can have an e mail address.

is there a way to make access create one, using outlook express, or anything
similar??
i just wanted to create some kind of reminder e mail, to say, please bring
yor rented film back to the store.

does any1 know of any sites, advice?

TIA

dev

DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True

Look up the SendObject method in VBA help.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 18 '06 #2

P: n/a
fredg wrote:
DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True


One irritating thing the help file does not tell you is that sendobject
DOES NOT WORK PROPERLY with netscape as the default mail client. It is
unable to fill in the to header and unless you have the email generated
so that you can physically add it in, it won't send a blinking thing.

This problem is with Access 2003 Sp2 and Netscape 7.2.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Feb 19 '06 #3

P: n/a
DP
hi,

i've put the code u gave me, and it all comes out in RED writing.

the email addess field is called EMailAddress which is in an
overduefilmquery called qryOverdueFilmRentalQuery

the code u gave me seems correct, but there is some kind of systax error or
something? if i can just get this email working, i can can add my own
fields/data in it.

thanx

dev

"fredg" <fg******@example.invalid> wrote in message
news:fe****************************@40tude.net...
On Sat, 18 Feb 2006 17:49:55 GMT, DP wrote:
hi,

is there a way to send an e-mail to a customer, using ms access?? or some kind of automated mail merge, so the user only has to review the body, and click send?

ive got a customer table, with a field called email address, where the
customer can have an e mail address.

is there a way to make access create one, using outlook express, or anything similar??
i just wanted to create some kind of reminder e mail, to say, please bring yor rented film back to the store.

does any1 know of any sites, advice?

TIA

dev

DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True

Look up the SendObject method in VBA help.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Feb 19 '06 #4

P: n/a
DP
hi,

this is wat ive got so far;

Private Sub cmdFilmMail_Click()

DoCmd.SendObject _
, _
, _
, _
"To****@doe.com", _
, _
, _
"Blockbuster Team - You have an Overdue Film Rental", _
"Dear Sir/Madem, You have an over film rental. Pleas could you return it
to your nearest blockbuster store.", _
True
End Sub

is there a way to link the email address field, to a field in my query? as
mentioned in the post before.
also i want to do the same, with the name (after the dear bit) and state the
'FilmID' 'FilmTitle' from the metioned query, into the email message.
the above code, opens an email message, ready to send.
thanx

dev
"DP" <DP@hotmail.com> wrote in message
news:O5******************@newsfe6-gui.ntli.net...
hi,

i've put the code u gave me, and it all comes out in RED writing.

the email addess field is called EMailAddress which is in an
overduefilmquery called qryOverdueFilmRentalQuery

the code u gave me seems correct, but there is some kind of systax error or something? if i can just get this email working, i can can add my own
fields/data in it.

thanx

dev

"fredg" <fg******@example.invalid> wrote in message
news:fe****************************@40tude.net...
On Sat, 18 Feb 2006 17:49:55 GMT, DP wrote:
hi,

is there a way to send an e-mail to a customer, using ms access?? or some kind of automated mail merge, so the user only has to review the body, and click send?

ive got a customer table, with a field called email address, where the
customer can have an e mail address.

is there a way to make access create one, using outlook express, or anything similar??
i just wanted to create some kind of reminder e mail, to say, please bring yor rented film back to the store.

does any1 know of any sites, advice?

TIA

dev

DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True

Look up the SendObject method in VBA help.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


Feb 19 '06 #5

P: n/a
In message <dt**********@coranto.ucs.mun.ca>, Tim Marshall
<TI****@PurplePandaChasers.Moertherium> writes
fredg wrote:
DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True


One irritating thing the help file does not tell you is that sendobject
DOES NOT WORK PROPERLY with netscape as the default mail client. It is
unable to fill in the to header and unless you have the email generated
so that you can physically add it in, it won't send a blinking thing.

This problem is with Access 2003 Sp2 and Netscape 7.2.


I've seen the same problem using Access 2000 and Turnpike as the mail
client. I suspect that it may only work with Outlook.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 19 '06 #6

P: n/a
DP
i sorted it, it it works perfectly!! damn i'm so good!!

thanx for all the help. :)

dev

"DP" <DP@hotmail.com> wrote in message
news:Sb******************@newsfe2-gui.ntli.net...
hi,

this is wat ive got so far;

Private Sub cmdFilmMail_Click()

DoCmd.SendObject _
, _
, _
, _
"To****@doe.com", _
, _
, _
"Blockbuster Team - You have an Overdue Film Rental", _
"Dear Sir/Madem, You have an over film rental. Pleas could you return it to your nearest blockbuster store.", _
True
End Sub

is there a way to link the email address field, to a field in my query? as
mentioned in the post before.
also i want to do the same, with the name (after the dear bit) and state the 'FilmID' 'FilmTitle' from the metioned query, into the email message.
the above code, opens an email message, ready to send.
thanx

dev
"DP" <DP@hotmail.com> wrote in message
news:O5******************@newsfe6-gui.ntli.net...
hi,

i've put the code u gave me, and it all comes out in RED writing.

the email addess field is called EMailAddress which is in an
overduefilmquery called qryOverdueFilmRentalQuery

the code u gave me seems correct, but there is some kind of systax error

or
something? if i can just get this email working, i can can add my own
fields/data in it.

thanx

dev

"fredg" <fg******@example.invalid> wrote in message
news:fe****************************@40tude.net...
On Sat, 18 Feb 2006 17:49:55 GMT, DP wrote:

> hi,
>
> is there a way to send an e-mail to a customer, using ms access?? or
some
> kind of automated mail merge, so the user only has to review the
body, and
> click send?
>
> ive got a customer table, with a field called email address, where

the > customer can have an e mail address.
>
> is there a way to make access create one, using outlook express, or

anything
> similar??
> i just wanted to create some kind of reminder e mail, to say, please

bring
> yor rented film back to the store.
>
> does any1 know of any sites, advice?
>
> TIA
>
> dev
DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True

Look up the SendObject method in VBA help.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail



Feb 19 '06 #7

P: n/a
In message <UZ*******************@newsfe6-win.ntli.net>, DP
<DP@hotmail.com> writes
i sorted it, it it works perfectly!! damn i'm so good!!


How?

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 20 '06 #8

P: n/a
DP
well it works if u have outlook express installed. i tried it on my m8s pc
today, and some msn 'passport' screen loads up, and then crashes. (Cos he
does not have outlook express)

is there anyway to check this? or to stop it from crashing?

i've got the code i'm using at the mo, if u want it?

thanx

devin
"Bernard Peek" <ba*@shrdlu.com> wrote in message
news:9Y**************@shrdlu.com...
In message <UZ*******************@newsfe6-win.ntli.net>, DP
<DP@hotmail.com> writes
i sorted it, it it works perfectly!! damn i'm so good!!


How?

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 20 '06 #9

P: n/a
"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> wrote in message
news:dt**********@coranto.ucs.mun.ca...
fredg wrote:
DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True


One irritating thing the help file does not tell you is that sendobject
DOES NOT WORK PROPERLY with netscape as the default mail client. It is
unable to fill in the to header and unless you have the email generated
so that you can physically add it in, it won't send a blinking thing.

This problem is with Access 2003 Sp2 and Netscape 7.2.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me


Also, with A2K, make sure you are using SP-3. There were some SendObject
bugs that MS fixed. Unfortunately for me, I have a client that bought a huge
& expensive software package from a firm that evidently wrote it for MS
Office SR-1. They claim that their warranty voids if they load any newer
patches. Thus my client won't load SP-3 (for fear that their expensive
software might crash) and thus my little A2K emailing project won't work for
them. Instead, they've asked me to change my database to print a report and
they will fax it daily to the 10 people that need it. How silly :(
Fred Zuckerman
Feb 20 '06 #10

P: n/a
In message <m5*******************@newsfe5-gui.ntli.net>, DP
<DP@hotmail.com> writes
well it works if u have outlook express installed. i tried it on my m8s pc
today, and some msn 'passport' screen loads up, and then crashes. (Cos he
does not have outlook express)

is there anyway to check this? or to stop it from crashing?

i've got the code i'm using at the mo, if u want it?


Sure. Email it if it's too long to post.

The code I'm using builds the "message" by appending the to address &
vbCrLf & Boilerplate. That leaves the email address as the first line of
the message, I cut and paste it from there.

I'm told that there is an alternative method that involves building a
mailto: URL, and that's reported to work with other mail clients. I'm
not about to rewrite my code unless someone is paying me to. (Anyone in
the UK looking for an IT Manager?)

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 24 '06 #11

P: n/a
DP
ok, its this;

Private Sub cmdFilmMail_Click()
DoCmd.SendObject _
, _
, _
, _
"Enter E-Mail address HERE", _
, _
, _
"Blockbuster Team - You have an Overdue Film Rental", _
" Our system has notified us, that you currently have a film overdue."
& vbNewLine & "Please can you return this film to your nearest Blockbuster
store, or a penalty charge will apply after 2 days." & vbNewLine & vbNewLine
& "Thank You. " & vbNewLine & "Yours Faithfully," & vbNewLine & vbNewLine &
"Blockbuster Team", True
End Sub

it works perfectly on my pc at home, just not on pcs that dont have outlook
express.
is there a way to detect if it can create the email? as if it cant, the
program hangs for about 30 secs, and then displays an error. can u refer me
to the 'mailto' thing u was talking about, maybe i could try that.

thanx

dev

"Bernard Peek" <ba*@shrdlu.com> wrote in message
news:MB**************@shrdlu.com...
In message <m5*******************@newsfe5-gui.ntli.net>, DP
<DP@hotmail.com> writes
well it works if u have outlook express installed. i tried it on my m8s pctoday, and some msn 'passport' screen loads up, and then crashes. (Cos he
does not have outlook express)

is there anyway to check this? or to stop it from crashing?

i've got the code i'm using at the mo, if u want it?


Sure. Email it if it's too long to post.

The code I'm using builds the "message" by appending the to address &
vbCrLf & Boilerplate. That leaves the email address as the first line of
the message, I cut and paste it from there.

I'm told that there is an alternative method that involves building a
mailto: URL, and that's reported to work with other mail clients. I'm
not about to rewrite my code unless someone is paying me to. (Anyone in
the UK looking for an IT Manager?)

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 24 '06 #12

P: n/a
In message <w0*******************@newsfe6-win.ntli.net>, DP
<DP@hotmail.com> writes
ok, its this;


OK. I'll take a look at that code, it looks a lot like mine (but
tidier.)

If you take a look in the demon.ip.support.turnpike newsgroup on Google
you should be able to find this message ID:

<g8**************@dessergroup.com>

It's part of a thread discussing the problems we had with Turnpike as a
mail client with Access.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 24 '06 #13

P: n/a
In message <wW**************@shrdlu.com>, Bernard Peek <ba*@shrdlu.com>
writes
In message <w0*******************@newsfe6-win.ntli.net>, DP
<DP@hotmail.com> writes
ok, its this;


OK. I'll take a look at that code, it looks a lot like mine (but
tidier.)

If you take a look in the demon.ip.support.turnpike newsgroup on Google
you should be able to find this message ID:

<g8**************@dessergroup.com>

It's part of a thread discussing the problems we had with Turnpike as a
mail client with Access.


I've tried this code now. It didn't take long. It works provided the
length of the mailto URL is less than 456 characters. That appears to be
true whatever mail client you use.

See: http://support.microsoft.com/default...b;en-us;182985

I've also discovered that there's no need to use the character
replacement function, I can just pass raw text as the subject and body
text.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Feb 27 '06 #14

P: n/a
Below is a function that is passed recipient string and memo body, but
requires Outlook. I work in large corporations, so almost all PC's
have standard build that include Outlook:

Function fxSendDBBackupReport(strRecipients As String, strLogInfo) As
Boolean

Dim objOutlookApp As New Outlook.Application
Dim objOutlookMail As Outlook.MailItem
Dim objOutlookAttachments As Outlook.Attachments

Set objOutlookApp = CreateObject("Outlook.Application")
Set objOutlookMail = objOutlookApp.CreateItem(olMailItem)

With objOutlookMail
.To = strRecipients
.Subject = "Report - " & Now
.Body = vbCrLf & vbCrLf & strLogInfo & vbCrLf & vbCrLf
.Send
End With

fxSendDBBackupReport = True

Exit Function

'releases resources from outlook and associated components
If Not objOutlookApp Is Nothing Then

objOutlookApp.Quit

If Not objOutlookMail Is Nothing Then
Set objOutlookMail = Nothing
End If

If Not objOutlookAttachments Is Nothing Then
Set objOutlookAttachments = Nothing
End If

Set objOutlookApp = Nothing

End If

fxSendDBBackupReport = False

End Function
James Igoe

ja********@gmail.com
Access/Excel VBA Developer
http://code.comparative-advantage.com

Feb 27 '06 #15

P: n/a
DP
so,

how could i test if outlook express or outlook is on the computer??

so then, if iether one of them is, the email button will work, and load up
the email message i've created?

thanx

devin

"Fred Zuckerman" <Zu********@sbcglobal.net> wrote in message
news:Dv******************@newssvr12.news.prodigy.c om...
"Tim Marshall" <TI****@PurplePandaChasers.Moertherium> wrote in message
news:dt**********@coranto.ucs.mun.ca...
fredg wrote:
DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailAddressField], ,
, "Item not returned", "Please return the film you have rented." &
vbNewLine & "There is a late fee of $2.00 per day.", True
One irritating thing the help file does not tell you is that sendobject
DOES NOT WORK PROPERLY with netscape as the default mail client. It is
unable to fill in the to header and unless you have the email generated
so that you can physically add it in, it won't send a blinking thing.

This problem is with Access 2003 Sp2 and Netscape 7.2.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me


Also, with A2K, make sure you are using SP-3. There were some SendObject
bugs that MS fixed. Unfortunately for me, I have a client that bought a

huge & expensive software package from a firm that evidently wrote it for MS
Office SR-1. They claim that their warranty voids if they load any newer
patches. Thus my client won't load SP-3 (for fear that their expensive
software might crash) and thus my little A2K emailing project won't work for them. Instead, they've asked me to change my database to print a report and they will fax it daily to the 10 people that need it. How silly :(
Fred Zuckerman

Feb 28 '06 #16

P: n/a
Like I said, it is designed for Outlook-assumed clients, but otherweise
you might need to check the registry. Information can be found here:

http://www.insideoutlookexpress.com/files/regkeys.htm

Also, you might need to make sure that it was also setup and the
default mail client.

I ran across this code that purports to work with everything, but does
not do attachments:

'**Module (space formatting added to make it easier to read):

Public Declare Function ShellExecute Lib "shell32.dll"
Alias "ShellExecuteA"
(ByVal hwnd As Long,
ByVal lpOperation As String,
ByVal lpFile As String,
ByVal lpParameters As String,
ByVal lpDirectory As String,
ByVal nShowCmd As Long)
As Long

'**Code attached to a button:

Dim stext As String

'Hard coded parts of the e-mail, stripped down to the minimum
stext = "mailto:me@myaddress.co.nz?"
stext = stext & "&Subject=" & "Document attached"
stext = stext & "&Body=" & "Please find the document attached"

'Launch default e-mail
Call ShellExecute(hwnd, "open", stext, vbNullString, vbNullString,
SW_SHOWNORMAL)

Feb 28 '06 #17

P: n/a
Red
sorry to chime in so late...
but...

http://www.granite.ab.ca/access/email.htm <--great email info for
access... and while alot of it (if not all) was based on A97, it is
very usefull in understand the mechanics of emailing in Access.

~Red

Feb 28 '06 #18

This discussion thread is closed

Replies have been disabled for this discussion.