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

Link to comment
Share on other sites

Thanks igance for your reply.

 

Here's my code:

 

<?php

require_once 'Mail.php';

/* mail setup recipients, subject etc */

$recipients = "alan.castaneda@isi-practical.com";

$headers["From"] = "alan.castaneda@isi-practical.com";

$headers["To"] = "alan.castaneda@isi-practical.com";

$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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.