sendobject

P

Patrick Stubbin

I am using sendobject to automatically send emails from with an access 2000
form.

When i do this i get a messge that a program , ie ms access is trying to
send an email and whether or not i want to stop the process, how do i get rid
of this message, is it within outlook that i have to do this or access?

pat
 
N

NewPCConsultant

Pat,
I have been dealing with this since it is due to the security patch that is
in Outlook. click yes is a down and dirty way to get around it. There is a
way to use VB to by-pass Outlook all together, but if you want to keep a copy
of the email for your records, you will have to email it back to yourself.
The code is as follows:

Public Sub Send_BATCH_Mail(FromEmail, SendTo, CCTo, Subject, Body, Attachment)

'***************************************************************************************************

' This Function Is Created in order to solve the Ms-Outlook problem which

' Prompt user’s confirmation during Batch e-mail process. The source of
the problem is

' the Microsoft security Update

'***************************************************************************************************



' test To Use CDO (Microsoft's Collaboration Data Objects ) instead of
outlook object

Dim imsg, iconf



Set imsg = CreateObject("CDO.Message")

Set iconf = CreateObject("CDO.Configuration")





If Attachment <> "" Then ' Include attachment if applicable.



'Set myAttachments = objMail.Attachments

imsg.AddAttachment Attachment



'myAttachments.Add Attachment, olByValue, 1, "Candidate Activity
Report"

End If

imsg.From = FromEmail

imsg.To = SendTo

imsg.CC = CCTo

imsg.Subject = Subject

imsg.TextBody = Body






iconf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2


iconf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail1.aegonusa.com"


iconf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25


iconf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 0

iconf.Fields.Update



Set imsg.Configuration = iconf

imsg.Send



End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top