Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with code

Status
Not open for further replies.

jozino01

Technical User
Joined
Apr 25, 2003
Messages
257
Location
CA
Hi,
I have the form to mail script; it works fine, except after submitting it shows part of the code in the Explorer windows:

aders[$header]."\r\n"; if(($success=$this->SendData($header_data."\r\n"))) { $this->PrepareData($body,&$body_data); $success=$this->SendData($body_data); } if($success) $success=$this->EndSendingData(); } } $error=$this->error; $disconnect_success=$this->Disconnect($success); if($success) $success=$disconnect_success; else $this->error=$error; } return($success); } }; } ?>OK.

The script is here:

<?php
$i=0;
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
//echo "<b>$key</b> = $val<br>";
$message = $message."$key = $val\n";
}
$message= "$message";
require("class.smtp.php");
$smtp=new smtp();
$smtp->host_name = "localhost";
$smtp->localhost = "host.sk";
$username = "doma52";
$password = "hju677hy";
$from = "md@stonline.sk";
$to = "jzn1@yahoo.com";
$subject = "Sprava z web-u";
$text = "$message";
$smtp->SendMessage( $from, array( $to ), array( "From: $from", "To: $to", "Subject: $subject" ), $text );
echo "<b>OK.</b>";
?>

Any idea how to fix it, please?
 
It must be your SMTP class that is generating some output.
Maybe there are some <? ?> tags in there, which shouldn't be there. The code is inserted into the very place where you have your require() statement.

I'd recommend to look at phpmailer.sourceforge.net and use that class, it's great and can do a lot. It will also include correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top