How can I remove the defualt attachement of Form1.xml from email

V

VicMan23228

Hello All,

I have designed a form that is intended to send system notifications. In
this form I have several views depending on the type of response to be
emailed.
I am using a button to submit the email. During that process I have preset
destination emails and related from views and all of that is working fine.

Except one part:

After I send the email that is generated I note that a file is automatically
added as an attachment right before the email gets sent (Form1.xml for
example). I have no control over this file except to predetermine its name.
This email attachment would be fine if it was only to be used internally with
in the company. This system notification will also target our clients.

Unfortunately, that attachment includes everything in the form including
email address and functionality/code that I am intestinally attempting to
hide from the receiver.

Is it possible to programmatically prevent a copy of the form from being
attached at all? Note: All I want the user to see is the results of the view
generated while the email is being generated.

Let me know if any of you have any ideas

Thank you,
 
S

Scott L. Heim [MSFT]

Hi,

You should be able to use code similar to the following on the click event
of a button - this is VBScript:

Dim objEmail
XDocument.View.SwitchView("vwPrint")
Set objEmail = Application.ActiveWindow.MailEnvelope
objEmail.Subject = "Test e-mail message"
objEmail.Visible = true

**NOTE: When you use this method, everything you see in the View appears in
the mail. As such, I created a "print view" (vwPrint) that only shows the
data and not all of the buttons. In this manner, I first switch to that
view and then create the e-mail from that "active window."

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
V

VicMan23228

Hello Scott,

Thank you for the feed back.

Please note that I was already doing this. The problem lies after the view
has changed and the email generated. In fact it only arises when I send the
email.

Let me see if I can explain it better.
When I hit the button in my form it switches Views calls Outlook 2003 and
preps the email completely. Now in that Outlook email window (Auto Generated
by InfoPath) I hit the send button and finally the email is sent.

All looks well until I receive what the customer actually got.
1) The email as I wanted him to see it.
2) PLUS a file attached to that email called form1.xml

That is the file I don’t want them to get. If I open this file it contains
all of my views, code and everything else. When I only wanted the user to get
the results of the one view nothing else. This means that the user can open
the xml file switch views and see everything we did in the back end to
generate the notification. Some of this stuff is confidential and should not
be seen by the customer at all.

To see this in action take a look at one of the built in templates in
InfoPath called Issue Tracking (Simple)
Create a second view just for testing.

Complete the Main view of the form and hit the button labeled "Send as Email".

See how it creates a form that is identical to that of an Outlook Email.
Also note that by default there are no attachments listed. Now send that
email to your self.

Look at the resulting email you received and the file that it attached while
the email was being sent.

Save that file attachment to your desktop. Now load it into InfoPath. See
you have everything you originally had including all of the diferent views.

I don’t want that just the view I submitted with and nothing else.

Any Ideas on how to prevent this file attachment or control it / lock it
down so that the end user does not get access to confidential information
with in other views in the form?

Thank you for your valuable time.
VicMan23228
 
S

Scott L. Heim [MSFT]

Hi,

Sorry for the misinformation - you are correct...the attachment is still
there and I have found there is no real viable way to send mail without the
attachment.

There is a "manual" method:

- Go offline first (disconnect from the network)
- Send the mail
- Go into your Outlook Outbox and delete the attachment from the mail
message.
- Come back online and the mail will be sent with no attachment.

But as you can see this is "user intensive." So at this point there does
not appear to be a way to accomplish what you need.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

Hi,

Unfortunately none that I have found.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Adam Harding

If i understand correctly there is no programming needed.

I send receipts without attachnig the form by deleting the word 'form' from
the email setup box, this works a treat.
 

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