Runtime e-mail still displays "Send on Behalf" Message

E

Eka1618

Hello,

I have recently split my DB and several users are working on a runtime
version of Access 2007. The code I have written to send e-mails eliminated
the message that pops up when you try to send and e-mail without editing it
first: "A program is trying to send an e-mail on your behalf..."

The code only seems to eliminate the message for users who have the full
version of Access 2007. I am wondering if anyone else has had this problem.
Below is a sample of how I am sending e-mails. If anyone knows how to solve
the runtime issue, please let me know. I do not want to use "Click Yes" or
"Redemption" methods.

Thank You!


'***********************************************************
' btnReport_Click - send confirmation that due date has changed.
'***********************************************************
Private Sub btnReport_Click()
'Send an e-mail using the outlook application object...
'version 1.0
'1.0: Initial version.

Dim outOutlookInstance As Outlook.Application
Dim maiMessage As MailItem
Dim lngCounter As Long
Dim strArray() As String
'Dim emName As String, varItem As Variant
Dim emailBody As String
Dim emailSubject As String

On Error GoTo SendEMail_Error

'Create the Outlook instance...
Set outOutlookInstance = CreateObject("Outlook.Application")


emailSubject = "Product Test Request Due Date Changed"

Me.REQUEST_NO.SetFocus

emailBody = "Hello, <br><br>" & _
"The product test request due date for Part Number: " & "<b><font color
= red>" & REQUEST_NO.Text & "</font></b>" & _
" has been changed.<br><br>"

Me.DUE_DATE.SetFocus

emailBody = emailBody & "New due date: " & "<b><font color = red>" &
DUE_DATE.Text & "</font></b><br><br>" & _
"Please reply to this e-mail weather or not this proposed date is
feasible." & "<br><br>" & _
"Thank You!"


'Create the mail message...
Set maiMessage = outOutlookInstance.CreateItem(olMailItem)
With maiMessage
.To = CurrentDb.Properties("RequestorEmail")
.SentOnBehalfOfName = CurrentDb.Properties("RequesteeEmail")
.subject = emailSubject
.HTMLBody = "<h2 align = center><b><font color = red>Product Test
Request Due Date Changed (Test Requestor Next
Action)</font></b></h2><br><br>" & emailBody

'Send the message...
.Send

End With

DoCmd.Close acReport, "rptRequestScreen", acSaveNo
DoCmd.Close acReport, "rptRequestPLK", acSaveNo
DoCmd.OpenForm "frmMain", acNormal, , , , acDialog
DoCmd.Close acForm, "frmDueDate", acSaveNo

'Clear the objects...
Set maiMessage = Nothing
Set outOutlookInstance = Nothing


SendEMail_Error:
If Err.Number <> 0 Then
MsgBox Err.Number & ": " & Err.description, vbCritical, "SendEMail"
End If
End Sub
 
E

Eka1618

Thank you for the advice Rick.

My code does turn off that message for those who have a full version of
Access. It took me a long time to figure out how to code it, but I eventually
got it.

Anyway, I am going to have someone check their virus protection to see if
that is the issue.

If anyone else has suggestions, please let me know, Thank You!
 
R

Rick Brandt

Eka1618 said:
Thank you for the advice Rick.

My code does turn off that message for those who have a full version
of Access. It took me a long time to figure out how to code it, but I
eventually got it.

Sorry, but that is standard Outlook automation code you are using. It does
nothing to inhibit the security warnings on a system that woudl normally
display them. If you don't get them on some machines it's for the reason I
stated in my previous post.
 
E

Eka1618

What are you sorry about?? Because it took me so long to figure out that
simple code? LOL

I am an Intern and I work independently on this project. I am new to
programming in Access so I do not know everything yet and I do not have many
resources...

I hope that it is the security issue, but with my luck it will be a runtime
issue. When we first got the DB split and up on the network, I had to add in
all kinds of Refrence dowloads in the instalation package because it was not
available in runtime version, so I wouldn't doubt that this issue is cause by
runtime.
 
R

Rick Brandt

Eka1618 said:
What are you sorry about?? Because it took me so long to figure out
that simple code? LOL

I was just pointing out that while your code accomplishes the task of
sending an Email message via Outlook it does nothing to suppress the
security warning. If you have some PCs getting the warning and some that do
not it has nothing to do with your code because your code is not the reason
why some computers are not getting the warning.
 
E

Eka1618

OH I C...

Well, I understand that it is probably a security issue. I also know that
the code did make the message dissapear and that is why I thought that there
could be some more code to add to what I already have to make it dissapear in
the runtime version.

I say that the code made it go away because I used to use SendObject. Since
the users here have Outlook, the message always appeared because I was not
defining who was sending the e-mail message (or who it was sent on behalf
of). So I looked up other methods to send the e-mail and chose the code that
you saw. Once I got that code working, the message dissapeared on my machine
and on all others who have the full version. This is why I believed (and
still do) that the code had something to do with it.

Do you think that the best way to get rid of it is using "Click Yes" or
something? I would prefer not to. I don't even know what my boss will want to
do if we cannot resolve this issue, we can always use .display and they can
send messages by viewing it first, but they would be better off just clicking
yes when the message appears....

I guess only time will tell :)
 
R

Rick Brandt

Eka1618 said:
OH I C...

Well, I understand that it is probably a security issue. I also know
that the code did make the message dissapear and that is why I
thought that there could be some more code to add to what I already
have to make it dissapear in the runtime version.

I say that the code made it go away because I used to use SendObject.
Since the users here have Outlook, the message always appeared
because I was not defining who was sending the e-mail message (or who
it was sent on behalf of). So I looked up other methods to send the
e-mail and chose the code that you saw. Once I got that code working,
the message dissapeared on my machine and on all others who have the
full version. This is why I believed (and still do) that the code had
something to do with it.

Do you think that the best way to get rid of it is using "Click Yes"
or something? I would prefer not to. I don't even know what my boss
will want to do if we cannot resolve this issue, we can always use
.display and they can send messages by viewing it first, but they
would be better off just clicking yes when the message appears....

I guess only time will tell :)

When I send a message that is not shown to the user first I don't use
Outlook. I use CDOsys which is a messaging library found on all Windows
versions 2000 and higher. It does not produce the security warnings.
 
E

Eka1618

Rick,

That would be a good option as well. I do not know anything about it, but
I'm going to look into it. We do believe that the warnings are most likely a
windows security issue, someone else is currently looking into it.

Thanks again for the help!
 

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