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

Citrix Code Compatibility? Email functions specifically 1

Status
Not open for further replies.

AlexCuse

Programmer
Apr 13, 2006
5,416
US
I have been working for a while (when I can find the time) on a work order tracking system for our department. This system allows end users to generate work orders and automatically notifies all parties who need to be informed. It also generates bills and does the same thing with them. We are publishing the application to the end user through Citrix server (just started testing) and on the surface everything seems to be working fine except for the email function. Here is my example code:

Private Sub XXXX_Click()


Dim appOutlook As Outlook.Application
Dim ItmNewEmail As Outlook.MailItem
Dim fs, f, f1, fc, s, i
Dim title As String
Dim folderspec As String

Set appOutlook = New Outlook.Application
Set ItmNewEmail = appOutlook.CreateItem(olMailItem)

If Forms("XXXXX").Controls("Department").Value = "Database" Then

With ItmNewEmail
.To = "alex@mycompany.com; rich@mycompany.com"
.CC = Forms("XXXXX").Controls("RequestorEmail").Value
.Subject = "New Work Order"
.Body = "A new work order has been submitted to " & Forms("XXXXX").Controls("Department").Value & " for Job Number " & Forms("XXXXX").Controls("JOBID").Value & Chr(13) & "The work order control number is " & Forms("XXXXX").Controls("WOID").Value & Chr(13) & Chr(13) & Forms("XXXXX").Controls("WODescription") & Chr(13) & "Due " & Forms("XXXXX").Controls("DateNeeded") & Chr(13) & Chr(13) & Forms("XXXXX").Controls("Instructions")


.Send ' send files and notification
End With

It looks like it is only getting to the very first line (dim appOutlook as Outlook.Application).

Does anyone know if there is some kind of issue with Citrix that will not allow you to send emails? It runs individual's PC Login and Password as well as server login script every time we start the application, and email addresses are attached to domain logins so I would not think it would cause a problem. Apparently it is though.

I have never worked with Citrix server before, and if anyone has experience publishing their applications through it and could help me out I'd really appreciate it. Thanks a lot,

Alex
 
Is MS Outlook installed on the PC? If not, you may need to send emails via a library (COD?) that support SMTP... htwh,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
It is installed on the PC. I'm a chester county resident myself, what's the website about?
 
Can u launch the app directly on the Citrix Server? and not through the metaframe software. Can u open Outlook and send an email directly from the server? What login is using the server and does it have an email account? U may need to switch the email profile for outlook to use another account. In that case, it starts to get complex.. perhaps SMTP is worth a look...

FYI: Library for SMTP is CDO, and may be one alternative. CDO is free from MS, I think and may already be installed on the server?

Web Site is dedicated to my neighbors who fought the city of Coatesville and eventually won an attempted land grab... Coatesville spent 7 million dollars on legal fees... and never got the land. Feel free to read the site.

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
The application was published through MetaFrame, but we are thinking now of installing it directly on the Citrix server. We can't get the email function to work, however, because Citrix won't let us call an application from the local desktop. I am not sure if IT people will go for installing Outlook on the server and setting up a special email account for the application to use, but is that the only option I really have here? The email notification is really one of the keys to the whole system working smoothly.

If anyone has experience with similar problems I'd love to hear what you did to get around it. Thanks a lot.
 
Here are some suggested reading on CDO... which I am going to use later this year since the network team is no longer installing MAPI clients (i.e. Outlook) on servers. My timeline is by Sept. to have a solution in place... so I expect to start in August... htwh,






Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Thanks a lot Steve, those were very helpful. Best of luck with your project, and be sure to vote today!
 
I am trying to configure it to use CDO instead of outlook, and I'm having a ton of data type issues. Is there anything obviously wrong with the code? It doesn't seem to recognize the cdo.Message or cdo.Configuration. I already registered the CDOEX.dll file. What more needs to be done to define these data types? Thanks a lot,

Alex

Dim cdoRef As Reference
Dim cdoMail As cdo.Message
Dim cdoCon As cdo.Configuration
Dim fs, f, f1, fc, s, i


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding

Set cdoRef = References.AddFromFile("C:\Program Files\Microsoft Office\Office11\MSOUTL.OLB")


Set cdoMail = CreateObject("cdo.message")
Set cdoCon = CreateObject("CDO.Configuration")
Set iFields = cdoCon.Fields
iFields.Item(" = 2 'Set send method to SMTP
iFields.Item(" = "172.16.1.78" 'designate server to generate email from
iFields.Update
Set cdoMail.Configuration = cdoCon
 
I got the code to work, it is running a bit slow because I was not able to declare as cdo.message and cdo.config, but it is running correctly. Because Citrix server is doing most of the work speed is not so much of an issue. Here is the code I used to start out, if anyone is interested:

Private Sub Submit_Click()

Dim cdoMail
Dim cdoCon


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding

Set cdoMail = CreateObject("CDO.message")
Set cdoCon = CreateObject("CDO.Configuration")
Set iFields = cdoCon.Fields
iFields.Item(" = 2 'Set send method to SMTP
iFields.Item(" = "XXX.XX.X.XX" 'designate server to generate email from
iFields.Update
Set cdoMail.Configuration = cdoCon
 
The only difference between this code and regular outlook code is that you must specify .HTMLBody or .TEXTBody, it chokes if you keep using .Body (In Access 2000 anyway). Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top