Prev: Mail Function Not Working
Next: Trouble running a select query against a database, when I know the connection is working, and the data is there
From: Alice Wei on 13 Apr 2010 09:54 Date: Tue, 13 Apr 2010 15:42:29 +0200 Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication From: tyra3l(a)gmail.com To: ajwei(a)alumni.iu.edu CC: php-windows(a)lists.php.net On Tue, Apr 13, 2010 at 2:24 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: Date: Mon, 12 Apr 2010 22:13:10 +0200 Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication From: tyra3l(a)gmail.com To: ajwei(a)alumni.iu.edu CC: php-windows(a)lists.php.net 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::factory("mail"); $your_name = $_POST['your_name']; = $_POST['email']; $question = $_POST['question']; $comments= $_POST['comments']; $submit = $_POST['submit']; if($_POST['submit']=="Submit") { $from = "elite.english(a)att.net"; $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 I did have that. I have include_path = ".;C:\xampp\php\PEAR;". Do I have to physically type in pear install Mail to install the Mail package here? Thanks. Alice _________________________________________________________________ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
From: Ferenc Kovacs on 13 Apr 2010 10:05 On Tue, Apr 13, 2010 at 3:54 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: > > ------------------------------ > Date: Tue, 13 Apr 2010 15:42:29 +0200 > > Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication > From: tyra3l(a)gmail.com > To: ajwei(a)alumni.iu.edu > CC: php-windows(a)lists.php.net > > > > On Tue, Apr 13, 2010 at 2:24 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: > > > Date: Mon, 12 Apr 2010 22:13:10 +0200 > Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication > From: tyra3l(a)gmail.com > To: ajwei(a)alumni.iu.edu > CC: php-windows(a)lists.php.net > > 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::factory("mail"); > > $your_name = $_POST['your_name']; > = $_POST['email']; > $question = $_POST['question']; > $comments= > $_POST['comments']; > $submit = $_POST['submit']; > > if($_POST['submit']=="Submit") > { > $from = "elite.english(a)att.net"; > $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 > > I did have that. I have *include_path = ".;C:\xampp\php\PEAR;"*. Do I have > to physically type in pear install Mail to install the Mail package here? > > As far as I remember, the xampp is by default contains the Mail package, but you should check the presence of the Mail.php in the C:\xampp\php\PEAR directory. the include_path seems good but the last ; is not necessary. Could you check that you removed the ; from the begining of the line, and that you don't have any other active include_path line in your php.ini, and you modified the correct php.ini? last time when I checked xampp, the php.ini was in xampp/apache/bin Tyrael > Thanks. > > Alice > > > ------------------------------ > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with > Hotmail. Get busy.<http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5> >
From: Alice Wei on 13 Apr 2010 10:17
Date: Tue, 13 Apr 2010 16:05:31 +0200 Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication From: tyra3l(a)gmail.com To: ajwei(a)alumni.iu.edu CC: php-windows(a)lists.php.net On Tue, Apr 13, 2010 at 3:54 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: Date: Tue, 13 Apr 2010 15:42:29 +0200 Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication From: tyra3l(a)gmail.com To: ajwei(a)alumni.iu.edu CC: php-windows(a)lists.php.net On Tue, Apr 13, 2010 at 2:24 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: Date: Mon, 12 Apr 2010 22:13:10 +0200 Subject: Re: [PHP-WIN] Send Mail from PHP Using SMTP Authentication From: tyra3l(a)gmail.com To: ajwei(a)alumni.iu.edu CC: php-windows(a)lists.php.net 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::factory("mail"); $your_name = $_POST['your_name']; = $_POST['email']; $question = $_POST['question']; $comments= $_POST['comments']; $submit = $_POST['submit']; if($_POST['submit']=="Submit") { $from = "elite.english(a)att.net"; $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 I did have that. I have include_path = ".;C:\xampp\php\PEAR;". Do I have to physically type in pear install Mail to install the Mail package here? As far as I remember, the xampp is by default contains the Mail package, but you should check the presence of the Mail.php in the C:\xampp\php\PEAR directory. the include_path seems good but the last ; is not necessary. Could you check that you removed the ; from the begining of the line, and that you don't have any other active include_path line in your php.ini, and you modified the correct php.ini? last time when I checked xampp, the php.ini was in xampp/apache/bin Interesting, l just checked my phpinfo() page, and the Loaded configuration file is claimed to be located at C:\xampp\php\php.ini, and the configure command, it reads cscript/nologo configure.js "--enable-snashot-build". The PHP_PEAR_SYSCONF_DIR is C:\xampp\php, When I use cmd to run the command, I type C:\xampp\php>pear and the output returns blank. Looks like I don't have PEAR installed. If these are included properly, how can I install it? Thanks. Alice _________________________________________________________________ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4 |