vbscript not running in php but running as a vbs file
vbscript not running in php but running as a vbs file
am 23.05.2009 10:57:48 von Rui
hi
im having a problem with a vbscript that sends mail .
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "mysubject"
objMessage.From = "mymail"
objMessage.To = "destinator"
objMessage.TextBody = "mytextbody"
objMessage.Configuration.Fields.Item("http://schemas.microso ft.com/cdo/configuration/sendusing")
= 2
objMessage.Configuration.Fields.Item("http://schemas.microso ft.com/cdo/configuration/smtpserver")
= "mysmtp"
objMessage.Configuration.Fields.Item("http://schemas.microso ft.com/cdo/configuration/smtpserverport")
= 25
objMessage.Configuration.Fields.Update
objMessage.Send
if i run this like a vbs file it runs like a charm . i receive the mail no
problem .
if i add this to a php page with the tags
it does not work . it does not give any error .....and if i check smtp
server log it does not even get to the server .
it looks either it does not process or it doesnt leave the workstation.
any ideias ?
thks in advance
rgds
rui
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: vbscript not running in php but running as a vbs file
am 23.05.2009 11:17:43 von harlequin2
Hi Rui,
Rui wrote:
> hi
> im having a problem with a vbscript that sends mail .
first of all, why do you try to send a mail through the use of a vbs
file? Consider switching to php's mail function
(http://www.php.net/mail), with your preferred mail server set up in
php.ini (or you can dynamically switch the server settings by using
ini_set()).
Let's get back to your initial problem:
if you are using Microsoft IIS, have a look at your webserver's
application event log. If the web server had any problems executing the
script (I bet on IUSR permissions problems), you'll have a good chance
to find the error here (if error reporting was set up to use syslog).
Otherwise enable error reporting before calling the vbs script from PHP:
[CODE]
error_reporting(E_ALL);
ini_set ("display_errors", "1");
[/CODE]
Could you post the code of your php script calling the vbscript file?
That'll help a lot!
Regards, Sascha
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: vbscript not running in php but running as a vbs file
am 23.05.2009 11:23:43 von harlequin2
Doh!
Now I found the error:
> if i add this to a php page with the tags
>
these lines will not be rendered by the server, the will directly be
send to the browser, so the browser will try to execute this part of
code (and only IE will process vbscript tags).
If you want the server to process the code, switch to:
>
but to be honest, I don't know if these lines will be parsed if they are
part of a php script file (which will be handled by php-cgi.exe); if
they were part of an asp script file, they will likely work.
Regards,
Sascha
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: vbscript not running in php but running as a vbs file
am 23.05.2009 12:27:29 von Geoff Lane
On Saturday, May 23, 2009, Sascha Meyer wrote:
> Doh!
> Now I found the error:
>> if i add this to a php page with the tags
>>
> these lines will not be rendered by the server, the will directly be
> send to the browser, so the browser will try to execute this part of
> code (and only IE will process vbscript tags).
> If you want the server to process the code, switch to:
> >
> but to be honest, I don't know if these lines will be parsed if they are
> part of a php script file (which will be handled by php-cgi.exe); if
> they were part of an asp script file, they will likely work.
I suspect that the OP wants the script to run on the client. However,
a long, long time ago Microsoft recognised the security implications
of permitting the calling of objects in client-side scripts and just
about put a stop to it. FWIW, I fell foul of this in 1996/97 when the
parts of a web application I'd written to use Word and Excel
client-side to format data suddenly stopped working.
--
Geoff
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: vbscript not running in php but running as a vbs file
am 23.05.2009 13:08:28 von Rui
hi all
thks all for the pointers .
sascha for sure you are a PHP Most Value Professional :)
i was not aware that i could set the values dynamically with init_set
.....that is way i didnt go for the php mail function as i didnt want to be
dependant on php configuration .
i will try both vbs and phpmail to keep my options open and of course just
for the fun of it .
thks again
rgds
rui
"Sascha Meyer" wrote in message
news:4A17C09F.5010409@gmx.de...
> Doh!
>
> Now I found the error:
>
>> if i add this to a php page with the tags
>>
>
> these lines will not be rendered by the server, the will directly be send
> to the browser, so the browser will try to execute this part of code (and
> only IE will process vbscript tags).
> If you want the server to process the code, switch to:
>
> >
>
> but to be honest, I don't know if these lines will be parsed if they are
> part of a php script file (which will be handled by php-cgi.exe); if they
> were part of an asp script file, they will likely work.
>
> Regards,
>
> Sascha
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php