Re: Fatal error: Class "Mail" not found
am 31.03.2008 04:05:11 von youu917On Mar 28, 4:32=A0pm, Erwin Moller " . $mail->getMessage() . " Message successfully sent!
> youu...@gmail.com schreef:
>
>
>
>
>
> >
> > require_once "Mail.php";
>
> > $from =3D "Sandra Sender
> > $to =3D "Ramona Recipient
> > $subject =3D "Hi!";
> > $body =3D "Hi,\n\nHow are you?";
>
> > $host =3D "mail.addplus.biz";
> > $username =3D "techni...@addplus.biz";
> > $password =3D "aptech";
>
> > $headers =3D array ('From' =3D> $from,
> > =A0 'To' =3D> $to,
> > =A0 'Subject' =3D> $subject);
> > $smtp =3D Mail::factory('smtp',
> > =A0 array ('host' =3D> $host,
> > =A0 =A0 'auth' =3D> true,
> > =A0 =A0 'username' =3D> $username,
> > =A0 =A0 'password' =3D> $password));
>
> > $mail =3D $smtp->send($to, $headers, $body);
>
> > if (PEAR::isError($mail)) {
> > =A0 echo("
> > =A0} else {
> > =A0 echo("
> > =A0}
> > ?>
>
> > i downloaded the code above from internet and i'd tried it in my
> > computer. However, i get the error message "Fatal error: Class 'Mail'
> > not found in C:\AppServ\www\seeyouu\mail.php on line 16".
> > Can anyone help me to solve this problem? i'm new to php, i totally
> > don't know what happen with this.
> > Thank you very much
>
> Erm, if you are totally new to PHP, why do you download scripts from the
> net and try to use them?
> Sounds to me like: "My moonrocket won't fly! Please help, I am totally
> new to rocketscience!"
> Wouldn't it make more sense to learn some PHP basics first?
>
> Anyway, you error means what it says: You are using a class in your code
> that doesn't exist in your script.
>
> Also, what is line 16? Is that the line that starts with:
> $smtp =3D Mail::factory('smtp', ??
>
> You started your script with:
> require_once "Mail.php";
>
> That require_once() means that your script will halt and produce a Fatal
> error if it cannot find Mail.php. So you did offer Mail.php at least.
>
> The class you are using is from the PEAR packages, I expect you didn't
> use PEAR right.
> You can find more information here:http://pear.php.net/
> but it might be hard to understand if you are totally new to PHP.
> Sorry. :-/
>
> Regards,
> Erwin Moller- Hide quoted text -
>
> - Show quoted text -
thank you