Mailing problem
Posted: Fri May 12, 2006 6:26 am
I'm trying to capture a visitor's name and email address to be sent on to my autoresponder (normally this would be don with the autoresponder form, but I need to go to a php script first to do sme other things).
The html form captures the information in 'name' and 'email' and passes them to a php script via POST.
Here is the code I've used in the php script:
An email is being sent to the autoresponder, but the username is logged as 'Nobody' and the email address is nobody@buffalo. etc (my server's root address, I guess).
Something isn't right! Can anyone tell me what?
Thanks.
Martin
The html form captures the information in 'name' and 'email' and passes them to a php script via POST.
Here is the code I've used in the php script:
Code: Select all
<?php
$name = $_REQUEST['name'];
if ($name=="") {$name="Friend";};
$email = $_REQUEST['email'];
$to = 'tracker@accountname.emailaces.com'; // the autoresponder signup by email address.
$subject = 'Subscribe';
$headers = "From: $name <$email>\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
mail($to, $subject, $headers);
?>An email is being sent to the autoresponder, but the username is logged as 'Nobody' and the email address is nobody@buffalo. etc (my server's root address, I guess).
Something isn't right! Can anyone tell me what?
Thanks.
Martin