Sending mails with iis

Koldo González

New Member
Hello.

I´m trying to send emails with ms outlook in a W200NT. The code i have works rigth when i execute it as a local user, but when i try to execute it via web (as iusr_mypc, the iis default user), progress doen´t open outlook. In a WXP with Apache as server works rigth.
I use the following code (taken from internet):

Code:
DEFINE INPUT PARAMETER OriginName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RecipName	AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER Subject	 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER Bodytext	 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER FilePathName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER iw_envaut AS INTEGER	NO-UNDO.
DEFINE VAR objEntry AS COM-HANDLE NO-UNDO.
DEFINE VAR objSession AS COM-HANDLE NO-UNDO.
DEFINE VAR objMessage AS COM-HANDLE NO-UNDO.
DEFINE VAR objRecip AS COM-HANDLE NO-UNDO.
DEFINE VAR objAttach AS COM-HANDLE NO-UNDO.
DEFINE VAR one AS LOGICAL INIT YES NO-UNDO.
DEFINE VAR lw_sesion AS LOGICAL. 
CREATE "MAPI.SESSION" objSession.
 
objSession:Logon("MS Exchange Settings").
objMessage = objSession:OutBox:Messages:Add().
objMessage:Subject = Subject.
objMessage:Text = Bodytext.
objRecip = objMessage:Recipients:Add().
objRecip:Name = RecipName.
objRecip:Type = 1.
objRecip:Resolve.
ObjAttach = objMessage:Attachments:Add().
ObjAttach:Name = "Fac".
ObjAttach:Source = FilePathName.
objMessage:Update(TRUE, TRUE).
objMessage:Send(TRUE, FALSE).
objSession:Logoff.
RELEASE OBJECT objRecip.
RELEASE OBJECT objMessage.
RELEASE OBJECT objSession.
 
QUIT.

Anybody have any ideas? Thanks.
 

jongpau

Member
When you say IIS does that mean you are using WebSpeed via a web browser? Or are you doing/using something else (how is the program executed via the web)?
 

Koldo González

New Member
I don´t use webspeed, I am executing the progress file via a php call located in the web space of a Internet Information Server Web Server:

Code:
<?php
system ("sendamail.lnk");
?>

This link has the info required to run procedure, something like that:

C:\DLC\bin\prowin32.exe -pf C:\webpath\pffile.pf -basekey INI -ininame bdname.ini

and takes the parameters from pffile.pf.

It does this OK, but when the procedure should execute outlook, it doesn´t.
 
Top