Mail Shot

Lanason

Registered User.
Local time
Today, 07:21
Joined
Sep 12, 2003
Messages
258
I have a database with a number of names and e-mail addresses. Based on a query to select a sub set of these, I want to send out an e-mail to them all - but with limited "mail shot" features - such as "Dear xyz" rather than a general "Dear Sir,"

What is the best way for access to fire off these e-mails ??? Could be 30 or 40 ish.

If I can do this I would also like to be able to send a "word Document" as an attachment.......

"reach for the stars........."
 
Last edited:
You want to create a recordset and then loop through it firing off each email (* you can do this with a query or with SQL *). Since this has been covered numerous times here is a link to get you everything you need Link

HTH,
Kev
 
Ouch

Thanks but the list is errr miles long and loads of the content goes zipping over my head.

However I've got this far:-

Private Sub Text36_DblClick(Cancel As Integer)
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("qry E-mail")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("FirstOfE-mail").Value
DoCmd.SendObject , , , strEmail, , , "E-mail message", "Adrian"
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
End Sub

The limitations are:-
1) I need to add more than just a few words of text
2) It seems to truncate some of the e-mail addresses.
3) I need to add an attachment
 
1) where are you trying to add more text? In the title/body?

2) Your problem may be the result of spaces in your table's field names trying bracketing things like: qry E-mail to look like [qry E-mail]

3) To add an attachement you add this to the SendObject Statement. See your current statement is only sending the email - to send the email with an attachment write it like this:
DoCmd.SendObject acSendReport, YourNameOfTheDocument, "PreferredFormatYouChoose",strEmail, , , "E-mail message", "Adrian"

For more assistance on this start to type out the DoCmd.SendObject in your code - as soon as you space after sendobject it will put up a tool tip to walk you through the rest of the options...

HTH,
Kev
 
Nearly

1) More text in the body - could even be a Word document or txt file etc.
2) i've added the [ ]
3) In the DoCmd.SendObject acSendReport, YourNameOfTheDocument, "PreferredFormatYouChoose",strEmail, , , "E-mail message", "Adrian"
Is the "YourNameOfTheDocument" an access report or similar ??
What is the Format ??

The Tool tip dissappears after a second or so - is that right
 
1) You can put as much text as you want in the body of the email. Simple replace the section "E-mail message" with your text. Now if this text is standardized (the same everytime) you can hard code it in the code or you can pull the information from a form or table... the choice is up to you...

2) Did the brackets take care of the problem?

3) Yes, I put YourNameOfTheDocument in there to show you where you input the name of the report. Here, again, this is the same as #1 where you can either have the same report or pull the name of the report from a form or table (your choice). The format its in is determined in the next section after the name, which I labeled "PreferredFormatYouChoose". Here you select what format the report will be in (snapshot, text, etc...)

HTH,
Kev
 
Getting closer

1) got the hang of this bit. Do you know how to put a carrage return into the text - is there a special character??

2) The [] made no difference - it still truncated the long e-mail address.

3) This puts an Access report as an attachment - do you know how to attach a file that exists on the Hard Disk - ie a word document and attach this.

Thanks for your help so far. I'm looking for a new job and using the Access Database to help with the search. Sadly, I'm not a Professional Programmer, but a Manufacturing Manager. :(
 
1) You lost me on this one.... sorry... Why don't you just format the email the way you want it to look and then import it as we discussed above?

2) If its cutting down the field that leaves me to believe that the field where your storing the email addy is not long enough - try lengthing the field...

3) I know how to do this in MS Outlook but I don't think its possible using the SendObject method... if your using Outlook I can help but if not someone else here should be able to help you out...

HTH,
Kev

Edit* - a work around using the sendobject method would be to set the False keyword at the end to True... this would result in each email populating and then opening so you could manually attach the email... you would have to do it for each one but it would work...:o
 
Last edited:
Broken Link

The second respond from the top (kevin's) the link is broken. Can anyone put the correct link.
 

Users who are viewing this thread

Back
Top Bottom