Email

lynsey2 said:
Thanks shadez!

Hay thats still not working at this end when i click on the email button i get a grey screen saying that a program is trying to send an email on your behalf... the to: is empty and subjest says subject then it has send or dont send... if i click on send a time line thing comes up and says message sent then the mesage box appears saying emails have been sent but im not getting the email at all??

1. not getting the email
2. its not asking what i want to attach??
3. where did outlook go i wanted to be able to type a message before i hit send?


1)My code wont work without the required "EmailPlus.DLL". As far as im aware you dont have this, it was to big to attach to the post.

2)You attach files via code, IE

Code:
buildemail.addattachment "C:\somefile.xls"

3)You can type a message just not in outlook "EMAIL PLUS DOESENT USE OUTLOOK", well it accualy uses you default mail client. To type a message add a text box and type there, you can the set the contents of the textbox to the settext property.




This post is about "Email Plus" only, If you dont want to use this code you can ignore this post.

Regards


ShadeZ
 
error message has just started to come up??

MSACCESS caused an invalid page fault in
module KERNEL32.DLL at 017f:bff7a138.
Registers:
EAX=09206e60 CS=017f EIP=bff7a138 EFLGS=00010206
EBX=0743f09c SS=0187 ESP=00626b9c EBP=00626bd0
ECX=6d20756f DS=0187 ESI=0743f028 FS=0e97
EDX=20656b61 ES=0187 EDI=09206ed4 GS=0000
Bytes at CS:EIP:
89 51 08 8b 53 08 8b 43 04 89 42 04 8d 93 0b 10
Stack dump:
00626bd0 0743f030 07340000 0734001c bff7b31d 07340000 0743f028 00000074 00000200 0743f044 0743f044 00000000 0743f028 0062e928 300734e7 07340000

this means absolutly nothing to me but im not sure why it is doing this, i have made a text box on the form frmSelect2Email for the emails content and set the false to true... outlook opens up with my message from the text box fine and the attachment when i click on send it does it fine for the first one but then gives me this error
 
...
 

Attachments

Lyns here's an updated copy of your db, the subform is now matching only records selected in your "type" category. I have created a table to hold your templates and set this to memo. You previously had the subform filtering the correct information based on the search but the email was not taking the subform results (this is now working) Next step is to select what template you need, I have created a table to hold your templates but I am a bit unclear on the next part, say for example there were 20 names in your subform, if you then select a template - will it be the same template for all 20 names listed in the subform or may you want to email contact 1 and 2 template1 and contact 3 and 4 template 2? I think what you need for the next bit (attaching your file) is to have explorer open and select the file(s) you need from here..now I've never done this part before and I don't pretend to know how to do this bit. Bukhix is really good on email and may be able to help you with the file attachments via explorer.

Hopefully the sample I've attached gets you started.
 

Attachments

Lyns how are you getting on with this? With the help of Bukhix I have managed to get a bit further with this than the sample I posted above so let me know if you want an updated copy. I'm still battling with a bit of the code for the explorer part though but we'll get there:)
 
Groupwise

I've been following (some) of this thread, and between this and some other threads i've managed to set up a means of sending an e-mail. This method seems to default to Outlook, which is loaded on my PC... but we use Groupwise as our e-mail.

As it happens, all looks well, but my e-mails are not being sent, even though all seems ok on the access side, at my end.

My question is this.. As Outlook doesn't seem to be working correctly/fully, how do i set up to make Groupwise my default?
 
Here's a copy that allows you to type in a message in the form and take this to outlook.

I'll come back to you when I have the other bit working.
 

Attachments

Buck I've manged to look at that link you gave me and make a command button to open explorer, now I can search through the folders - how do I then add the attachment from here to the email?

Latest copy below if you need to see what I have so far

Cheers
Hay
 

Attachments

This should do the trick. Look for a form that says "BucksForm" open that and press the button. You should get an open dialog box. Just pick your file and it should be inserted right into Outlook as an attachment.

The Module used to spark the Open Dialog is from here: Call the standard Windows File Open/Save dialog box

I just modified it slightly to work with Outlook.
 
Last edited:
That's super, thanks very much for all your help. I've learned loads from you:)

Thanks once again
Hay
 
No problem. I am glad it is going to work out for you.

FYI I am not sure whether you noticed or not but I did not use the BrowseFolder module at all in my solution. I used the GetFile one noted on the post above.
 
Yes I did notice that, the Getfile one seems to do the trick. I suppose you could do it the other way too (I must have just missed something) I'm off to have a better look at the code behind it.

Thanking you
 
dbemail.zip

Mile-O-Phile said:
Have a look at this.

Hi all. Been watching this thread with great interest and leaning heavily on Hayley's experience. Mile-O-Phile I really wanna see your dbemail version but have office 2k... I'm interested in two things I just can't master despite reading all the notes/literature I can lay my hands on:
1. How you open up an email from within access
2. How you loop through a query and collect all the email addresses, placing a semi colon between each one.

I want to be able to email groups of people from my system but don't want the email to go automatically, I want it to sit in Outlook so I can write it there and attach any items etc. before I send.
 
Re Editing an e-mail.

Set the editmessage part to true and you'll be able to edit it before it goes.

This is the format of SendObject

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile].

Does anyone know how/where to specify the e-mail default software eg to Groupwise? instead of Outlook.
 
When emailing a group of people it is better to type your message in the form and take this to outlook, reason being if you have a group of 40 contacts to email, first taking this to outlook to type your message means you'll see this for every email it picks up so in the end you'll end up hitting send 40 times in outlook which kind of defeats the purpose of looping through a recordset and gives you or whoever will be using your db more work. Have a look at the last example I posted to see if that helps - select a category type > search > search results displayed in subfrm (your group of contacts to email) Type in a message of your choice > hit send > everyone in the group receives the same message individually by the click of one button.

Also the latest example posted by Bukhix really is fantastic, it allows you to search any file of your choice and attach it to the email.
 
Still Here... Still Trying

It's difficult to explain why I have to do it this way and not send individual emails to a group of people without going into huge detail about our clients etc... but I've given it a lot of thought and this really is the way our marketing people want to do it...

So, I want to create a bit of code that opens a query as a recordset, loops through it and takes out all the email addresses, putting a semi colon between each one, and then outputs that to an email bcc field where the user can then format their email.

I've started trying to piece it together from the very start using all your tips and advice but already it's coming up with error messages over the declaring of the variables!!!

Private Sub Command47_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String

Set rsEmail = CurrentDb.OpenRecordset("qryEmail")

Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("Email").Value
(NEED TO ADD SOMETHING IN HERE TO ATTACH A ; BETWEEN EACH ONE)
rsEmail.MoveNext
Loop

DoCmd.SendObject , , , , , strEmail, , , True

End Sub


It doesn't like the DAO.Recordset declaration and it doesn't like the Set rs statement either! Can anyone explain to me why this is and where I'm going wrong?
:confused: :o
 
Ok using Miles example to select the names and list them in the recipients box, I have added an email command button to this which takes over the selected emails in the recipients box to the bcc section of outlook.

Hope this helps
Hay
 

Attachments

DAO.Recordset

Thanks this is great. However, when I write the code in my application it says the type isn't defined for DAO.Recordset - why is that?
 
Your missing a library reference. Go into View menu > Code. Now select Tools > References. I'm not sure which one you are missing but if you do this with the sample and your own db and compare the lists. All you then need to do is add them by checking the box and all should work fine.

More than likely it will Microsoft DAO 3.6 Object Library
 

Users who are viewing this thread

Back
Top Bottom