Full Version: email from Access
UtterAccess Forums > Microsoft® Access > Access Forms
I am createing a DB that will contain a long list of business contacts. The data will be normalized and I will use 4 tables. I can create a form to allow the user to select the records they want ....like (ContactType="Realtor"). All that works fine.
The users want the ability to e-mail the group of contacts on the list that they have selected. My company uses Novell Groupwise for email. I currently use Access97 but I am about to upgrade to 2003.
I want export the list of email addresses then import them into Groupwise but there must be a better way.
Thanks you for any information you can offer.
Candace Tripp
There are many ways to e-mail from Access.
I have demos on my site which use various methods, Outlook, CDO, and SendMail.
For Groupwise, the SendMail method worked for me IF AND ONLY IF Groupwise was open on the desktop. This was in the '98-'99 timeframe. I don't remember which version.
You should also try the CDO method as it may work also.
You can use the SendObject method
DoCmd.SendObject acSendNoObject, , , strToPerson, strCCPerson , strBCCPerson , strSubjectLine, strEmailMsg, True

Where all the variables (strToPerson, etc.) you can set in code before this line. You do not have to have GroupWise open. If it's not open, you'll get a dialog box asking you to choose/verify your default e-mail program. Just click OK and GroupWise will open, your e-mail message will be constructed and the cursor will sit there ready for you to click SEND.
First of all, thank you both very much SerranoG and Candace Tripp for your help.
Opasted SerranoG's code
My first try did not do anything at all when I click the button ...no error, nothing happening
I checked off the references that showed "Groupwise" in the name of the reference.
When I click the "send email" button Groupwise opens if it's closed whithout asking me any questions (works fine), but then it doesn't do anything else.
Thanks for any additional thoughts you may have.
one last thing SendMail does not seem to be available in this version of Access that I'm using but SendObject is available for me to use.
Thank You
Are you assigning values to strToPerson, strCCPerson, strEmailMsg, etc.? If you're not, the e-mail will pop open but it will have nothing in it.
My code looks like this:
Private Sub Command12_Click()
Dim strToPerson, strSubjectLine, strEmailMsg As String
strToPerson = Me.ToPerson
strSubjectLine = Me.SubjectLine
strEmailMsg = Me.EmailMsg
DoCmd.SendObject acSendNoObject, , , strToPerson, , , strSubjectLine, strEmailMsg, True
End Sub
Groupwise opens but a new email message is not created. I just see the normal view of Groupwise as if I opened it manually. I'm going to try to go to another PC here at work that has a new version of MS Office and give it a try.
Thanks for any thoughts you may have.
I tried the code on a PC with Access2K and it worked exactly as you said it would.
It's amazing to me that I can get that much functionality out of so little code.
Is there any way I can click the Send button on my Form and have the email be sent, without having to click send again on the Groupwise email? It doesn't seem like it would be such a big deal, but the "contacts DB" will be used to send broadcast emails to groups (a list of contacts).
Thanks you enourmously for your knowledge.
Yes, change the TRUE to FALSE. That will tell Access to go ahead and send it without waiting. For one e-mail at a time, I tend to set it to TRUE to allow the engineers here the ability to proof-read and add to what's being sent first. But if your users are not adding anything, you can have the mail just sent automatically.
h, be sure to do some error trapping in case GroupWise is down. The code will fail, so you can put a message that says, "GroupWise is currently unavailable. Please try again later."
WOW !!
It worked great !!!!!
Ocan't beleive it works so nicely.
Thank you so much for your help.
ext I am going to work on sending an email to a list of emails. I guess I would have to create a recordset.
Thank again
If you're sending one e-mail to many people, you simply have to set up the strToPerson variable correctly. For example, if you want to send the e-mail to everyone in the Detroit office, you'd have to scroll through the recordset to get the right office and then in that loop.
strToPerson = strToPerson & "; " & strGroupWiseID

Where strGroupWiseID is pulled from your table of employees filtered by office.
I use that code with my ms.outlook, and set that option to FALSE also.
But I get pop-up screen to confirms sending by ms.outlook. It concerns
about virus. How do I ignore this screen by codes?
Thank you very much!
Check out my demo on using Groupwise Tokens to email from Access
this is a great thret, i learned a bunch, in here,
what would you have to do or change if you want the list to be based on a query or filter the table
want to be able to send an email using outlook to all members in in the membercontact table based on their status
to be able to choose form a combo box prompting the status of membership i want to contact via email
is this going to be to confusing for me?
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.