Re: Send Mail from PHP Using SMTP Authentication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 13, 2010 at 2:24 PM, Alice Wei <ajwei@xxxxxxxxxxxxx> wrote:

>
> Date: Mon, 12 Apr 2010 22:13:10 +0200
> Subject: Re:  Send Mail from PHP Using SMTP Authentication
> From: tyra3l@xxxxxxxxx
> To: ajwei@xxxxxxxxxxxxx
> CC: php-windows@xxxxxxxxxxxxx
>
> http://www.php.net/manual/en/ini.core.php#ini.include-path
>
> Tyrael
>
> I tried installing the Pear Mail package, it is now located in
> php/PEAR/Mail, and my code is located in the htdocs. Here is the code:
>
> require_once("Mail.php");
> $mail
>  = Mail::factory("mail");
>
> $your_name = $_POST['your_name'];
> $email
>  = $_POST['email'];
> $question = $_POST['question'];
> $comments=
> $_POST['comments'];
> $submit = $_POST['submit'];
>
> if($_POST['submit']=="Submit")
>  {
> $from = "elite.english@xxxxxxx";
> $to =  $email;
> $subject =
> "Comments Regarding HH Web Design Studio";
> $body = "From:
> $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n
> $comments";
>
> $host = "smtp.att.yahoo.com";
> $username =
> "my_user_name";
> $password = "password";
> $headers = array ('From'
> => $from,
>    'To' => $to,
>    'Subject' => $subject);
> $mail->send($to,
>  $headers, $body);
>
> if (PEAR::isError($mail)) echo "<p>" .
> $mail->getMessage() . "</p>";
>
> This is what I get:
>
> Fatal error:  Class 'Mail' not found in
> C:\xampp\htdocs\Alice.Wei\web\mail.php
>  on line 30
>
> Do I need to move the Mail PEAR class to the
> same folder as my web folder? How can I make sure that my Pear is
> running?
> Thanks for your help.
>
>
http://www.php.net/manual/en/ini.core.php#ini.include-path
set the PEAR path to your include_path in your php.ini
...
gosh

Tyrael

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux