Pass PHP data to Microsoft Outlook New email window Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeremyphpdn
Forum Newbie
Posts: 6
Joined: Thu Dec 21, 2006 6:38 pm

Pass PHP data to Microsoft Outlook New email window Question

Post 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?
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

Post 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
jeremyphpdn
Forum Newbie
Posts: 6
Joined: Thu Dec 21, 2006 6:38 pm

Post 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.
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

Post 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
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post 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.
jeremyphpdn
Forum Newbie
Posts: 6
Joined: Thu Dec 21, 2006 6:38 pm

Post 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?
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post 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>
Post Reply