REPOSTING - Embedding attachments

I have an agent that creates an email with text and also attaches pdf’s through LS. This agent worked great when Domino resided on the AS400 (where the attachments are). The Domino server has been migrated to a Windows 2003 server and now when I run the agent, it will not embed the attachments to the email. Here is part of the code: Does anyone have any ideas as to what I need to change so that it will embed the attachment:

AttServer = result4.GetValue (“QZYJT6”)

AttShare = Result4.GetValue (“QZYKT6”)

AttPath = result4.GetValue (“QZYLT6”)

AttFile = result4.GetValue (“QZYMT6”)

'filename = ""+ AttPath + "" + AttFile

'filename = “\” + AttPath + "" + AttFile 'changed from above line for windows 2003 server

filename = “\” + AttShare + "" + AttPath + "" + AttFile

Set object = rtitem.EmbedObject (Embed_Attachment, “”, filename)

If ( object Is Nothing ) Then

Messagebox( “Unable to find an object” )

Print “Unable to find object”

Else

Messagebox( “Found an object” )

Print “able to find object”

End If

I have checked the permissions on the folder on the AS400 through iSeries Navigator and my id has proper access to the data. Do I need the Notes Server to have access to that folder. When I try a run command from the server and put my user name and password in, I can get to the server and then drill down but cannot put the entire path in to begin with. Does anyone have any ideas as to how I might get this to work.

Subject: Slashes?

Not my area of expertise…but…

Might you not have to put the extra slash in all " " references?

filename = “\” + AttShare + "" + AttPath + "" + AttFile

should be:

filename = “\” + AttShare + “\” + AttPath + “\” + AttFile

Subject: RE: Slashes?

I will definitely try that and let you know.

Subject: RE: Slashes?

Nope – that wasn’t it. I believe it has to do with permissions but I’m just not sure how to make it right.

Subject: Same Domain?

So…from your PC you can map a drive to the server and get to that path correct?

Are these files on the Domino Serveror another NT server?

Is your PC and the server in the same NT Domain?

Your right…sounds like a permissions thing… Is the code running as you or the Domino server?

Feel free to email me: dnaramor@csc.com

Subject: RE: Same Domain?

I’m leaving for the day but will email you directly tomorrow with the answers. Thanks for your help.

Subject: REPOSTING - Embedding attachments

“When I try a run command from the server and put my user name and password in”

Cindy,

Your EmbedObject method assumes you have access to the drive. When you do the run command it prompts you for credentials. You can not pass these in with the EmbedObject method.

you might try using FTP.

I have never done this, but this link sheds some light on using an activeX control to ftp a file up. Maybe you could use the control in reverse and pull the file down from you 400.

https://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/91aa286671067f8685257125004f28d5?OpenDocument

We have some 400 experience here and if need be I could ask those folks about the how and why of FTP on 400. I know we have it working but don’t know a stitch about 400 myself.

Cheers,

Shawn

Subject: RE: REPOSTING - Embedding attachments

Okay – How do I get the drive to recognize that I do have access to it.

Subject: REPOSTING - Embedding attachments

Hey Cindy,

As well, what are the values in these variables after hte code executes on a record?

AttServer = result4.GetValue (“QZYJT6”)

AttShare = Result4.GetValue (“QZYKT6”)

AttPath = result4.GetValue (“QZYLT6”)

AttFile = result4.GetValue (“QZYMT6”)

Thanks,

Shawn

Subject: RE: REPOSTING - Embedding attachments

It’s pulling the file path from a file on the AS400. Someone else enters the file path for the attachments and my agent goes and gets the values and then creates a string for the embed attachment. Like I said previously, it worked great when the Domino server was on the AS400 but now that the domino server is on the Win 2003 server, I am having problems obtaining the files.

Subject: RE: REPOSTING - Embedding attachments

This is almost certainly a permissions issue.

If the agent is running on the server then it is most likely running as the LocalSystem administrator (not the domain admin) which probably can’t see the directories on your AS400. This is not as easy to sort out as you would think.

The easiest way to get around this is to use FTP, as suggested before.

Download the notesFTP script library from the sandbox - it will let you ftp to and from the as400 and you will be able to log on to the as400 with your user account.

Hope that helps

Ben