Email Examples

Mmccl

Enough to be Scary
Local time
Yesterday, 23:53
Joined
Nov 26, 2003
Messages
43
The People of this Forum have been such a help, thought I would post a sample of the finished product.

Many of you probably know how to do all of these in your sleep, but for those who don't, this may save the rest of you some time answering all those repeated email questions.

Here are 3 Examples of how to send Email using Outlook Express from within Access. (at least in Access 2000)

1. Email to a single record in a table from a form.

2. Bulk Email with Your Selected Parameters.

3. Personalized Email with Same Message to all recipients with Your Selected Parameters.

Hope this helps anyone as much as it helped me.

Thanks again Everyone for all the Help! This whole Example was basicly put together by those on this forum.
 

Attachments

These examples are great and worked very well until Windows XP security patch 2.

Have these been changed at all to use CDOsys?

Thanks
 
I appreciate the examples you provided. being a noobie at this bulk email loop thing, can I get a little guidence.

I have a qry names qry_email with the email field named info_email on that query.
I have a button placed on the form. I copied the script over to the button on_click event. Since I am not using any parameters. I rem'd them out so they are ignored. The following is my code:

Private Sub cmdbulkemail_Click()
Dim cat As New ADOX.Catalog
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset

Dim strEmail As String
cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Procedures("qry_email").Command
'cmd.Parameters("[Forms]![EmailExp1]![Tit]").Value = _
' [Forms]![EmailExp1]![Tit]
'cmd.Parameters("[Forms]![EmailExp1]![YesNo]").Value = _
' [Forms]![EmailExp1]![YesNo]
'cmd.Parameters("[Forms]![EmailExp1]![ST]").Value = _
' [Forms]![EmailExp1]![ST]
'cmd.Parameters("[Forms]![EmailExp1]![RG]").Value = _
' [Forms]![EmailExp1]![RG]
'cmd.Parameters("[Forms]![EmailExp1]![Dept]").Value = _
' [Forms]![EmailExp1]![Dept]

'Set rs = cmd.Execute
With rs
Do While Not .EOF
strEmail = strEmail & .Fields("PrimaryEmailAddress") & ";"
.MoveNext
Loop
.Close
End With
strEmail = Left(strEmail, Len(strEmail) - 1)

'Set cmd = Nothing
On Error GoTo Err_Command2_Click
DoCmd.SendObject _
, _
, _
, _
, _
, _
("" & strEmail), _
, _
, _
True

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

I get an error on the Dim cat As New ADOX.Catalog line
I even set the references the same as in the examples.
What am i doing wrong.

Thank you VERY much for any help.

Jon
 
I'm having the same problem - appreciate any help.

Thanks
 

Users who are viewing this thread

Back
Top Bottom