Jump to content

Problems with sending an email in PHP using the Mail module


alancgmty2099

Recommended Posts

Hello all

 

I installed the mail and net_smtp PEAR modules but I get the following error message when I type

http://localhost/mailer1.php

 

Fatal error: Cannot redeclare class Mail_smtp in C:\Program Files\xampplite\xampplite\php\PEAR\Net\smtp.php on line 348

 

Does anybody know what ths problem is with this?

 

I would appreciate any help...Thank you

Thanks igance for your reply.

 

Here's my code:

 

<?php

require_once 'Mail.php';

/* mail setup recipients, subject etc */

$recipients = "[email protected]";

$headers["From"] = "[email protected]";

$headers["To"] = "[email protected]";

$headers["Subject"] = "User feedback";

$mailmsg = "Hello, This is a test.";

/* SMTP server name, port, user/passwd */

$smtpinfo["host"] = "";

$smtpinfo["port"] = "25";

$smtpinfo["auth"] = true;

$smtpinfo["username"] = "";

$smtpinfo["password"] = "";

/* Create the mail object using the Mail::factory method */

$mail_object =& Mail::factory("smtp", $smtpinfo);

/* Ok send mail */

$mail_object->send($recipients, $headers, $mailmsg);

 

 

In the file smtp.php, the class Mail_smtp extends the class Mail, however, I don't see this class redeclared

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.