sending PHP mails from localhost (SMTP/mailserver) - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-05-2011, 02:50 PM   #1 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 1
Default sending PHP mails from localhost (SMTP/mailserver)

HI there im hosting my own website and i would like some help sending mail from it using php, after several failures it has left me desperate..

when i use this script:
PHP Code:

ini_set
('smtp_port',587);
ini_set('SMTP','outgoing');
ini_set('sendmail_from','working domain');

  
$subject 'Request';
  
$message $_REQUEST['strname']."\n"$_REQUEST['straddress'] ;
  
$to="other mail";
  
$host "outgoing"
  
$port 587

  
mail($to$subject$message"FROM: xx <sending mail>"$host);

  echo 
"Thank you for using our mail form";

 
?> 
Even though i inserted every single of information from my (working) outlook 2007 settings (provided from isp)
i got a SMTP auth error "550 Authentication required", and someone told me that it was because i needed to auttenticate the password and username provided from my ISP, and a way to work out that was using PEAR....

however when using the PHP include function to include "mail.php"
i get the:

"Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\m=foruml=0sl=0forum.ws438,239,320,6177 2675\Mail\Request.php on line 46"


SO should keep trying to use PEAR og should i try something else?

Last edited by v6coderh; 02-06-2011 at 07:55 AM.
v6coderh is offline   Reply With Quote
Sponsored Links
Old 02-12-2011, 06:15 PM   #2 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 39
Default Re: sending PHP mails from localhost (SMTP/mailserver)

You also need to set the correct headers and check your PEAR include path.

Last edited by Webby Dev Rob; 02-12-2011 at 06:45 PM.
Webby Dev Rob is offline   Reply With Quote
Old 02-24-2011, 01:40 PM   #3 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 16
Default Re: sending PHP mails from localhost (SMTP/mailserver)

i've tried this once but we were using joomla so it was just a plugin installed
aokiji1 is offline   Reply With Quote
Old 02-25-2011, 04:09 PM   #4 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 39
Default Re: sending PHP mails from localhost (SMTP/mailserver)

Based on the code you've provided above you should have no issues.

However, as you're having issues with an included file elsewhere in your script you need to check the file location of PEAR.php.

As this is special file from the PEAR library you can manually set a PEAR include path in your php.ini
Webby Dev Rob is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:33 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting