Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Automation and New Outlook Security 1

Status
Not open for further replies.

Caryisms

Technical User
Oct 17, 2001
132
US
How can I send email using the DoCommand.SendObject method without having to confirm each email?

After installing Microsoft's service releases, new security features will not allow me to mass email a customer base.

It states "An application is automatically trying to send email. Do you want to continue?"

HELP!!!
 
First off, unless you're using A97 or below, be cautious of using DoCmd.SendObject - it's buggy in A2000 and A2002. Check out for a feature-rich Outlook-based workaround.

Secondly, to get round the behaviour you describe (which is the result of a Microsoft security patch to limit the damage viruses like Melissa and LoveBug can do) take a look at Outlook Redemption at - this used to be freeware, not sure of its current licence status.

Hope this helps.
 
Zig1,

How do I use this application to send the emails? Thank you.
 
Hi Caryisms,

If you downloaded the application, there should be an icon on your desk top and, when activated, an icon on the toolbar on the lower right of your screen.

When you double click on the red "X", it turns into a black check and your application will not require the reply to the Outlook Email question.

If you look at the readme, probably in Program Files\Express ClickYes, it explains how to use it.

On the website, there are samples of CC, Delphi, VB/VBA, Visual Foxpro, and VB Net, that allow you to turn it on and off via VBA rather than double clicking on the Icon.

Regards,

Zig1
 
Zig1,

What red "X" are you referring to? I have a little Sponge Bob on my desktop and on the toolbar. Can you please be very specific about how to auto-confirm the Outlook security questions?

Thanks!
 
Hi Caryisms,

On the tool bar on the bottom of the screen, you should have a white box with the word "Click" over the top and a red circle with a white "X" in it on the bottom right portion of the icon.

If you do not, find the Express ClickYes Icon on your desk top or go to C:\Program Files\Express ClickYes\ClickYes.exe. Double clicking should bring up the icon on your toolbar.

Double click on that icon on your tool bar and the Red circle with white "X" should change to a black check mark.

Double clicking on the icon switches between these two values. When the black check mark is visible, you should not be asked to reply to the security question in outlook when you run your Access Module.

Either leave the icon off your toolbar, or leave it with the red x unless you intend to send e-mails via Access so that the normal security feature will prevent viruses from using yur computer to send e-mail.

Please see below the test Access Module that i have used to confirm that I can send e-mail via Access.

Sub emailtest()

'******begin code******
Dim email As String, Metric As String, origin As String, destination As String, notes As String
Dim eBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim Goal As Double
Dim Actual As Double
Dim frm As Form
Dim ctltxt As Object
Dim lstrcd As Integer
'**gathers information from your form. this sets the string variable to your fields
DoCmd.OpenForm "email"

Set frm = Screen.ActiveForm
DoCmd.GoToRecord , , acFirst

Do Until lstrcd = 2

email = Forms!email!email
Metric = Forms!email!Metric
Goal = Forms!email!Goal
Actual = Forms!email!Actual
notes = Forms!email!notes
If Actual > Goal Then
eBody = "Please review results: " & Metric & " Metric" & Chr(13) & Chr(13)
eBody = eBody & " Metric Goal =" & Goal & Chr(13)
eBody = eBody & " Actual =" & Actual & Chr(13) & Chr(13)
eBody = eBody & " at: " & notes
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

'***creates and sends email
With objEmail
.To = email
'.CC = Insert cc name
.Subject = Metric & " Metric Failure "
.Body = eBody

.Send
End With

'**closes outlook
'Set objEmail = Nothing
'objOutlook.Quit
End If
'Go to next record in Table
DoCmd.GoToRecord , , acNext
lstrcd = lstrcd + 1
Loop
DoCmd.Close

End Sub

Regards,

Zig1

Regards,

Zig1

 
Zig1,

You are awesome! It was a separate download from the Express site. Once I downloaded the "Click Yes" .exe, it worked beautifully. Thank you.
 
I have created on inhouse programe in the VB6 and backend is Acess 97. I want to send a mail from vb6 to a particular or verious email address which has mention in the acess another table. if it's possiable can u send the total code.

Regards
Biswajit
 
Hi Biswajit,

I think you could use the code above.

The key portion for sending e-mail is:
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

'***creates and sends email
With objEmail
.To = email
'.CC = Insert cc name
.Subject = Metric & " Metric Failure "
.Body = eBody

.Send
End With

'**closes outlook
'Set objEmail = Nothing
'objOutlook.Quit
End If

The other portions of my e-mail above just loads the email recipient, cc, (if any), subject, and body

Regards,

Zig1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top