PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail » Bug #5254

Mail_smpt::send echo's to screen

Details

Submitted2005-08-31 11:55 UTC
Fromglen at uknetweb dot com
Assignedjon
StatusClosed
PackageMail
PHP Version4.3.9
OSLinux
Roadmaps(Not assigned)

Comments

[2005-08-31 11:55 UTC] glen at uknetweb dot com

Description:
------------
When using Mail_smtp, the send function echo's "Disconnecting" to the output.

Line 270

Code below requires hostname, username and password for SMTP server.

Test script:
---------------
<?php
include('Mail.php');
include('Mail/mime.php');

function sendMail($data) {
$crlf = "\n";
$hdrs = array('From' => $data['from'], 'Subject' => $data['subject'], 'To' => $data['to']);

$mime = new Mail_Mime($crlf);

$mime->setTXTBody($data['plain']);

$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$params = array ('host' => 'insert_hostname', 'port' => '25', 'auth' => 'PLAIN', 'username' => 'insert_username', 'password' => 'insert_password', 'debug' => FALSE);

$mail =& Mail::factory('smtp', $params);
return $mail->send($data['to'], $hdrs, $body);
}

$data = array('from' => 'glen@uknetweb.com','to' => 'glen@uknetweb.com','subject' => 'Bug','plain' => 'This is a bug');

$result = sendMail($data);
?>

Expected result:
----------------
[glen@dev Mail]# php echo_bugtest.php

Content-type: text/html
X-Powered-By: PHP/4.3.11

Actual result:
--------------
[glen@dev Mail]# php echo_bugtest.php

Content-type: text/html
X-Powered-By: PHP/4.3.11

Disconnecting