Automate Email

marrett

Registered User.
Local time
Today, 18:12
Joined
Sep 8, 2000
Messages
43
I am trying to create an email and send it automatically. I can set it up with all the information, but I cannot get it to send.

Thanks

Maria
 
I already answer my own question

Thanks, anyway
 
Re: I already answer my own question

marrett said:
Thanks, anyway

How do you send an email automatically
 
Reply Auto send emails

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


Set rsEmail = CurrentDb.OpenRecordset("EmailList")

Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EmailAddress").Value
DoCmd.SendObject , , , strEmail, , , "Test 3", "Hi", False
rsEmail.MoveNext

Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent"

End Sub

The above function will send emails to all the people in the table emaillist.
 
Re: Reply Auto send emails

thanks for that but can you get all the email address to appear in same TO: field in the message window and so you can bypass pressing the send button

thanks
 
Send one email at same time to all

rivate Sub cmdSendMail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String


Set rsEmail = CurrentDb.OpenRecordset("EmailList")
strEmail = rsEmail.Fields("EmailAddress").Value
rsemail.movenext

Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.Fields("EmailAddress").Value

rsEmail.MoveNext

Loop
DoCmd.SendObject , , , strEmail, , , "Test 7", "Hi", False
Set rsEmail = Nothing
MsgBox "Emails have been sent"

End Sub

This worked for me I hope this helps
 
Re: Send one email at same time to all

Thanks very much you are the master of code. Just one more question is there a way of not letting each recipient seeing who else has been emailed.

Thanks
 
Hide Addresses

I am not sur if this can be done. I am not very good at outllook. I would just send the same email to all the people seperately. It would still work and it would be automated.

Maria
 
If you were to change:

DoCmd.SendObject , , , strEmail, , , "Test 3", "Hi", False

to

DoCmd.SendObject , , ,"you@yourisp.ext" , ,strEmail, , "Test 3", "Hi", False

It should place the addresses in the BCC area and To: box would show your email only

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage]
 
This is what I have been looking for! Thanks for posting Marrett.

Autoeng
 
Marrett:

Wonder if I can pick your brain to customize the code you posted to fit my app. Two questions below

1) The code looks at the "EmailAddress" field. I have several fields that my names are in. What is the syntax to call the information from several fields?

2) I want to attach a report in snapshot format which I do with the following code.

Dim stDocName As String

stDocName = "ECNBCNVIPrpt"
DoCmd.SendObject acReport, stDocName, "Snapshot Format"

What do I need to change to continue doing this?

Thanks for any help that you can give.

Autoeng
 
Emailing with attached

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

stDocName = "ECNBCNVIPrpt"




Set rsEmail = CurrentDb.OpenRecordset("EmailList")
strEmail = rsEmail.Fields("EmailAddress").Value
rsEmail.MoveNext

Do While Not rsEmail.EOF
If IsNull(rsEmail!EmailAddress) Then
strEmail = strEmail & " ; " & rsEmail.Fields("Email2").Value 'Other email addresses
Else
strEmail = strEmail & " ; " & rsEmail.Fields("EmailAddress").Value
End If



rsEmail.MoveNext
Loop
DoCmd.SendObject acReport, stDocName, "SnapShot Format", strEmail, , , "Test 7", "Hi", False
Set rsEmail = Nothing
MsgBox "Emails have been sent"

End Sub


I was really unsure about what your specs were for what other fields your emails were in. write bach if this doesn't help.

maria
 

Users who are viewing this thread

Back
Top Bottom