Page 1 of 1
Pass PHP data to Microsoft Outlook New email window Question
Posted: Wed Jan 03, 2007 10:48 am
by jeremyphpdn
I am looking to pass PHP version 4.4.1 data from our hosted PostgreSQL 8.1.2 database to launch a Microsoft Outlook New Mail window from the Internet Explorer client side.
I want the result to be an HTML email in Outlook which the user is able to hit send after reviewing. Are there any ideas where I can direct my energies, please?
Posted: Wed Jan 03, 2007 10:52 am
by andym01480
What email program is a user choice.
Code: Select all
<a href="mailto:recipient@email.co.uk?subject=subject&body=body">Email</a>
Would generate a link for a new email
subject could be whatever you want as could body. How to specify whether html or text format is again a user choice!
The other way would be to output the result to the browser with an option to send and then send it using PHP's mail() function or swiftmail
Posted: Wed Jan 03, 2007 11:07 am
by jeremyphpdn
Thanks for your response.
The limitation with the mailto link is it will not accept HTML tags within so I can't use it.
The target user will assuredly be using Outlook as only the employees of our company will be using this software and it's company policy to use Outlook. The intent is to produce an HTML email with the PHP data in a new Outlook window. At this point the user then has the ability to edit the information and send. The email will then be stored in their Sent Items so they will have a record of emails sent.
Posted: Wed Jan 03, 2007 11:20 am
by andym01480
PHP is a server side language and I can't see how it can open an Outlook window on the client side.
But you can output the data to the browser in a form that the user can amend and then submit sends it formatted as an html email to the recipient and BCC to the user
Posted: Wed Jan 03, 2007 2:05 pm
by kingconnections
I do some similar stuff at work as well. What we had to do is not use outlook and have the script mail the html email to whoever was intended. So basically we made a little interface for them to mail what was needed for that one instance.
I do not think that php itself can interact with outlook. You might be able to do something with exec() but that would happen on your web server.
Posted: Wed Jan 03, 2007 2:31 pm
by jeremyphpdn
So if PHP cannot interact directly with Outlook perhaps I can use a go between? I found a VBscript which will open a new Outlook mail message window. Does anyone know if PHP could send variables to a VBscript or other programming script?
Posted: Wed Jan 03, 2007 2:34 pm
by kingconnections
You can using vbscript or javascript languages inline with php. You just call it like you would javascript.
Code: Select all
<script type="text/vbscript">
document.write("Hello from VBScript!")
</script>