Connecting Tech Pros Worldwide Forums | Help | Site Map

Using MS Access to send Email

Newbie
 
Join Date: Aug 2006
Posts: 2
#1: Aug 31 '06
I would like to send an email with MS Access 97.
In our bussiness with don't use MS outlook or MS outlook express.
Instead we use teamware.

Can anyone help me out with sharing his code on this issue.

Thanks
Marc B

Newbie
 
Join Date: Sep 2006
Posts: 1
#2: Sep 1 '06

re: Using MS Access to send Email


Create a command button on a form and paste the code below on the On Click event procedure...

Private Sub cmdEmail_Click()
Dim strToWhom As String
Dim strSubject As String
Dim strBody As String
Dim strMsgBody As String
Dim intSeeOutlook As Integer

strToWhom = InputBox("Enter recipient's e-mail address.")
strSubject = InputBox("Enter Subject.")
strBody = InputBox("Enter Text.")

'strToWhom = "xxx.xxx@xxx.com"
'strSubject = "This is a test"
'strBody = "This is a test"


DoCmd.SendObject , , , strToWhom, , , strSubject, strBody, intSeeOutlook
x = MsgBox("Email has been sent")

End Sub
Newbie
 
Join Date: Aug 2006
Posts: 2
#3: Sep 4 '06

re: Using MS Access to send Email


Thanks for your reply.
I used the code you presented before.
However it doesn't work.
everytime I get the following error
Microsoft Access can't open the mail session.
Check your mail application to make sure it's working properly.
That was my problem in the beginning.
I am not using outlook instead I'm using TW Mail from teamware.
In the internet exporer I can't select this program to make this the default
program for my emails.
I will need some further assistance to get the program working.
Reply