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 12 Apr 2010 16:06 Hi, Just as I am exploring some of my alternatives for using the mail() in PHP, I came across a web page that one of the users on the list has provided me: http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm. Does anyone know what the Mail.php is referring to here? <?php require_once "Mail.php"; $from = "Sandra Sender <sender(a)example.com>"; $to = "Ramona Recipient <recipient(a)example.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; ?> If it is something from PEAR package, why isn't it necessary for it to specify the path to that code? Can it tell by itself? Thanks for your help. Alice _________________________________________________________________ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
From: Ferenc Kovacs on 12 Apr 2010 16:13 http://www.php.net/manual/en/ini.core.php#ini.include-path Tyrael On Mon, Apr 12, 2010 at 10:06 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: > > Hi, > > Just as I am exploring some of my alternatives for using the mail() in > PHP, I came across a web page that one of the users on the list has provided > me: > http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm. > Does anyone know what the Mail.php is referring to here? > > <?php > > require_once "Mail.php"; > > $from = "Sandra Sender <sender(a)example.com>"; > > $to = "Ramona Recipient <recipient(a)example.com>"; > > $subject = "Hi!"; > > $body = "Hi,\n\nHow are you?"; > > ?> > > If it is something from PEAR package, why isn't it necessary for it to > specify the path to that code? > Can it tell by itself? > > Thanks for your help. > > Alice > > > _________________________________________________________________ > Hotmail is redefining busy with tools for the New Busy. Get more from your > inbox. > > http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
From: Niel Archer on 12 Apr 2010 16:13 > > Hi, > > Just as I am exploring some of my alternatives for using the mail() in PHP, I came across a web page that one of the users on the list has provided me: http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm. Does anyone know what the Mail.php is referring to here? > > <?php > > require_once "Mail.php"; > > $from = "Sandra Sender <sender(a)example.com>"; > > $to = "Ramona Recipient <recipient(a)example.com>"; > > $subject = "Hi!"; > > $body = "Hi,\n\nHow are you?"; > > ?> > > If it is something from PEAR package, why isn't it necessary for it to specify the path to that code? > Can it tell by itself? Because if PEAR is setup correctly, then its directory is in the include path and this file will be found there. > Thanks for your help. > > Alice > > > _________________________________________________________________ > Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. > http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 -- Niel Archer
From: Alice Wei on 13 Apr 2010 08:24 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. Alice On Mon, Apr 12, 2010 at 10:06 PM, Alice Wei <ajwei(a)alumni.iu.edu> wrote: Hi, Just as I am exploring some of my alternatives for using the mail() in PHP, I came across a web page that one of the users on the list has provided me: http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm. Does anyone know what the Mail.php is referring to here? <?php require_once "Mail.php"; $from = "Sandra Sender <sender(a)example.com>"; $to = "Ramona Recipient <recipient(a)example.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; ?> If it is something from PEAR package, why isn't it necessary for it to specify the path to that code? Can it tell by itself? Thanks for your help. Alice _________________________________________________________________ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 _________________________________________________________________ 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 09:42
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 .... gosh Tyrael |