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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendobject warning 2

Status
Not open for further replies.

pronate

Technical User
Jul 7, 2002
64
0
0
SG
hi,

I suspect that this is setting is not in Access, but when i try to use sendobject to send an email, there will also be a warning massage, saying that "Outlook is trying to send an email.......if this is a virus, you should choose no."

How can i do away with this message. it sort of cause alarm to the users. I try to DoCmd.SetWarnings False, but the warning still comes up.
 
Thanks Nathan,

I found an alternative by using "postie".
 
pronate,
Can you please elaborate on what you mean by "using 'postie'"?

I'm working on a database that will automatically send email notifications (sometimes through Outlook), and I'm looking for a work-around.

Thank you.
 
KornGeek,

Postie is a small stand alone program. It sends out emails by a command line in dos.

You can down load this program, and in VBA, execute in with the appropraite arguments to send emails.

Just do a search on Postie, you will find the site for download. It works well for me.
 
I'm sorry to be getting into too late, but KornGeek
I would like to know what operating system you are using postie on? I'm trying to use postie in win XP, and it's not working.
Can you give me a sample of what you send out using postie?
thanks

-Kim
 
I don't use Postie so I can't help you there. But the following we have had success as a "workaround" the Outlook security feature.
The "trick" is to open the the e-mail you are trying to send, then send it.

Set App = CreateObject("Outlook.Application")
Set ITM = App.CreateItem(olMailItem)

With ITM
.Subject = Esubject
.To = SendTo
.Body = Ebody
.Attachments.Add NewFileName
.Attachments.Add IntFile
.Display 'This opens the e-mail for viewing
' .Send 'This sends without opening the e-mail (you will get the prompt)
End With

SendKeys "%{s}", True 'This sends the e-mail (won't work if you are stepping through)
.MoveNext
Loop
End If
End With
 
There are bits of code missing in the above post that has teh SendKeys statement. Where are you declaring the objects and what are you looping through?

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Try commenting out all the code past the "sendkeys" statement. Then it should work.
 
Here is the complete code. The SendKey is used as a work around for the Outlook security message. We send several emails at one time that have individual attachments depending to whom the email is being sent. So, if there are 50 e-mails then then attachments are for that person only. You might notice there is "Call sSleep" (seperate module) it's a time delay. It seems to work smoother when I open the message wait 2 seconds then send it.

Dim Atchfile As String
Dim IntFile As String
Dim Message As String
Dim App As Object
Dim ITM As Object
Dim DB As Database
Dim Regnme As Recordset
Dim Esubject As String
Dim SendTo As Variant
Dim Ebody As String
Dim NewFileName As String
Set Xfile = GetObject(, "Excel.application")
With Xfile.ActiveWorkbook
Atchfile = .Path
End With
If Me!Check15 <> -1 Then
Message = MsgBox("You Have Not Put A Check In The All Jurisdictions Selected Box Yet.", vbOKOnly)
GoTo Exit_CmdEstart_Click
End If
SendAuditPack
Insert54
CommonDialog1.CancelError = True
CommonDialog1.InitDir = Atchfile
CommonDialog1.Flags = &H1000& Or &H800&
CommonDialog1.Filter = "All PDF Files (*.pdf)|*.pdf|Word Files (*.doc)|*.doc"
CommonDialog1.DialogTitle = " Select The Interest Report. "
CommonDialog1.ShowOpen
IntFile = CommonDialog1.Filename
Set DB = CurrentDb
Set Regnme = DBEngine(0).Databases(0).OpenRecordset("qrypickJuris")
With Regnme
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
Const ctime = 1500
Call sSleep(ctime)

SendTo = !EMailAddr 'SendTo & !EMailAddr & ";"
' .MoveNext
' Loop
' End If
'End With
Esubject = "IFTA Audit" & " " & !JurisID
Ebody = " The attached Audit Summary is for" & " " & Me.TxtTpName & ", " & "their license number is " & Me.TxtLinNo & " and covers the years " & Me.TxtYrs & "." _
& vbCrLf & vbCrLf & vbCrLf _
& " EMAIL Confidentiality: " _
& "This communication may contain privileged information. " _
& "If you are not the intended recipient, or believe that you may have " _
& "received this communication in error, please reply to the sender " _
& "indicating that fact and delete the copy you received. In addition, " _
& "you should not print, copy, retransmit, disseminate or otherwise use the information in this communication."

NewFileName = Atchfile & "\" & "IFTAJuris" & " " & !JurisID & ".pdf"

Set App = CreateObject("Outlook.Application")
Set ITM = App.CreateItem(olMailItem)

With ITM
.Subject = Esubject
.To = SendTo
.Body = Ebody
.Attachments.Add NewFileName
.Attachments.Add IntFile
.Display 'This opens the e-mail for viewing
' .Send 'This sends without opening the e-mail (you will get the prompt)
End With
Call sSleep(ctime)

SendKeys "%{s}", True 'This sends the e-mail (won't work if you are stepping through)
.MoveNext
Loop
End If
End With


Set Xfile = Nothing
Set ITM = Nothing
Set App = Nothing
Regnme.Close
Set Regnme = Nothing

End
 
To stop the security warning, go into outlook express and go to top, select tools/options, then security and uncheck the "warn me if other applications try sending email as me"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top