RE: [PHP] mail() problem affecting output to browser on completion

2003-06-07 Thread John W. Holmes
> Alright with the following code I am using is printing/echoing to the
> browser a "1" before the html output. It's like it's adding 2
variables
> together.
> 
> Here is what I am trying to do. I have a form that enters information
to a
> text file, and at the same time sends the information to a
predetermined
> email address. This email example is one that I made up on my server,
but
> will work for this example. I need it to stop printing the number "1"
> before
> the rest of the page's output.
> 
> $address = "[EMAIL PROTECTED]";
> $subject = "Your Feedback Page has been submitted\n";
> $body = "The following is the information that was entered.\r\n";
> $body .= "Message Type: $messageType\r\n";
> $body .= "Subject: $subjectbody\r\n";
> $body .= "Other Subject: $otherSubject\r\n";
> $body .= "Comments: $comments\r\n";
> $body .= "User Name: $username\r\n";
> $body .= "Email Address: $email\r\n";
> $body .= "Telephone Number: $telephone\r\n";
> $body .= "Fax Number: $fax\r\n";
> $body .= "Contact Option: $contact\r\n";
> $moreheaders = "From:
> [EMAIL PROTECTED]:
text/html\n";
> $send = mail($address, $subject, $body, $moreheaders);
> echo $send;

Why are you echoing $send? If mail() succeeds, it returns 1 (TRUE),
which is assigned to $send, which you then print. The script is doing
exactly what you tell it to do. 

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mail() problem affecting output to browser on completion

2003-06-07 Thread PHP4 Emailer
Alright with the following code I am using is printing/echoing to the
browser a "1" before the html output. It's like it's adding 2 variables
together.

Here is what I am trying to do. I have a form that enters information to a
text file, and at the same time sends the information to a predetermined
email address. This email example is one that I made up on my server, but
will work for this example. I need it to stop printing the number "1" before
the rest of the page's output.

$address = "[EMAIL PROTECTED]";
$subject = "Your Feedback Page has been submitted\n";
$body = "The following is the information that was entered.\r\n";
$body .= "Message Type: $messageType\r\n";
$body .= "Subject: $subjectbody\r\n";
$body .= "Other Subject: $otherSubject\r\n";
$body .= "Comments: $comments\r\n";
$body .= "User Name: $username\r\n";
$body .= "Email Address: $email\r\n";
$body .= "Telephone Number: $telephone\r\n";
$body .= "Fax Number: $fax\r\n";
$body .= "Contact Option: $contact\r\n";
$moreheaders = "From:
[EMAIL PROTECTED]: text/html\n";
$send = mail($address, $subject, $body, $moreheaders);
echo $send;


I noticed that the 1 is being entered in right as I call the Print command
or in this case "echo" (I have tried using 'print $send' aswell). Knowing
this doesn't solve my issue as all the echo/print command does in general is
to start referencing my variables from earlier within the same script.  Also
if you need the whole script I can send that aswell.  The part right here is
what's bugging me,because if I take this out of the script, it works fine,
just doesn't send an email but it still writes to the text fine and then
displays without the 1, the problem is somewhere in this script section. I'm
assuming, hehe
Any help would be much appreciated. Thanks in advance


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php