tags:

views:

58

answers:

2

I'm sending an HTML email which is only going to be opened using Microsoft Outlook.

Here's the HTML for the email:

<form action='http://server.com/unsubscribe.php' method='post'>
<input type='hidden' name='email' value='".$row1['EmailId']."' />
<input type='submit' value='Unsubscribe me'>
</form>

Here's the code for unsubscribe.php:

<?php
    $id=$_POST["email"];
    echo ($id);
?>

It appears that Outlook never actually calls the PHP script. I verified that it doesn't get called by putting an intentional error in the PHP script and watching the error log and I don't see the error.

I need to give the receiver a way to unsubscribe. What should I do?

+4  A: 

You can only call PHP from the webserver, so you need to modify each email you send to be sent with a custom ID.

As Mark Biek said, you might just want to have a URL to a page to unsubscribe rather than a form, especially in an email.

http://example.com/unsubscribe/[email protected]

Then when they click on the link, it would take them to a form on your webpage where you could unsubscribe them.

Chacha102
+1 for seeing the problem behind a poorly explained question.
Iceman
+4  A: 

Outlook will not let you post a form from an email message. It is a security concern. You need to have an unsubscribe link described in one of the comments.

Byron Whitlock