I'm forwarding this to the Internals list as a last resort and at the suggestion of someone with PHPCommunity.org. I have not received any response from php-general or pear-general (after 24 hours), and I have posted a similar posting about this issue several weeks ago (also with no response). I have just upgraded my Windows Server 2003 to the Apr 6 2004 20:12:15 build of PHP 5RC1 from snaps.php.net. Here's my phpinfo() page: http://test.alpharetta.ga.us/info.php

I am not sure whether this is a bug with PHP, but I am sure that you guys can tell that.

Any help at all is much appreciated. We cannot launch this site until this issue is resolved, and don't ask me to revert back to a stable version of PHP or we will have to modify much code throughout the site. ;-)

Thanks,
Ben


-------- Original Message -------- Subject: PHP Access Violation using PEAR::Mail_smtp Date: Mon, 05 Apr 2004 13:58:31 -0400 From: [EMAIL PROTECTED] (Ben Ramsey) To: [EMAIL PROTECTED], [EMAIL PROTECTED] Newsgroups: php.general,php.pear.general

I'm getting the following error when using the Mail_smtp package from PEAR:

PHP has encountered an Access Violation at 0177A8B4

It does not occur everytime I use it, but even when send() returns true,
e-mail messages are not being sent.  However, it all worked fine a week
ago when I was testing it, and I don't think anything has changed to my
installation of PHP.

I'm using PHP 5RC1 on a Windows Server 2003.  The localhost has no
built-in mail functionality, so I cannot use mail().  I must use
Mail_smtp to log in to the mail server.  I also have Net_SMTP and
Net_Socket installed, and, like I said, when I first dropped in my code,
all was working fine.

My code is, as follows:

<code>
require_once 'Mail/smtp.php';

$smtp_settings = array(
    'host'     => 'localhost',
    'port'     => '25',
    'auth'     => 'LOGIN',
    'username' => 'username',
    'password' => 'password'
);

$to = "[EMAIL PROTECTED]";
$msg = "Line 1\nLine 2\nLine 3";
$headers = array(
    'Subject'      => "My Subject",
    'From'         => "[EMAIL PROTECTED]",
    'Date'         => date('r'),
    'Content-Type' => 'text/plain',
    'X-Mailer'     => "PHP/" . phpversion()
);

$mail = new Mail_smtp($smtp_settings);

if ($mail->send($to, $headers, $msg)) {
    echo "<h2>Sent successfully</h2>";
} else {
    echo "<h2>Not sent</h2>";
}
</code>

If I don't get the access violation error, I get the message "Sent
successfully."  Yet, I don't receive any messages.

In the code for Mail_smtp (in Mail/smtp.php), I have added the following
line just under the function declaration line for the send() method:

echo "test";

When the access violation occurs, I get this line:

PHP has encountered an Access Violation at 0177A8B4test

From this, it appears to me that the access violation is not occurring
when the class tries to send mail, but sometime earlier than that.
However, I do not know much more about these Access Violoations, other
than PHP is trying to access memory that it doesn't have permission to
access.  I couldn't find anything at bugs.php.net or through Google that
helped much with this problem.

Any help would be greatly appreciated.  I am on a tight deadline, so any
help ASAP would be even more greatly appreciated.  ;-)

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to