How do I setup phpmailer in Windows?

the mail() function

Moderators: macek, egami, gesf

w1n78
New php-forum User
New php-forum User
Posts: 5
Joined: Wed May 18, 2005 6:12 pm
Contact:

How do I setup phpmailer in Windows?

Postby w1n78 » Wed May 18, 2005 6:20 pm

I've read the installation instruction but still can't get it to work. I edit the php.ini and added the path to the include_path...
(before) include_path = "c:\php\pear";
(after) include_path = "c:\php\pear;c:\php\3rdparty\phpmailer";

But I still get the warning message that says it can't find it. It works if I put the phpmailer folder in one of the directories in my site. I would like it to work the first way so that I don't have to keep adding the phpmailer folder on every site I need it on.

I googled and can't find an explanation that an ordinary person can understand. All that I found assume you are born knowing PHP

Here are what I'm using:
Windows XP Pro SP2 / IIS 5.1 / PHP 4.3.11 / PHPMailer 1.72

Thanks in advance

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sat May 21, 2005 11:26 pm

you need an SMTP server, it works on your site because probably it has sendmail running
for Windows XP,
  1. open "inetmgr" from the "Run"
  2. Go to SMTP virtual server. and Enable it by pressing Start/Play button
  3. Right click on it and open properties
  4. go to the Access tab
  5. press relay button, and add 127.0.0.1 and your local IP address

w1n78
New php-forum User
New php-forum User
Posts: 5
Joined: Wed May 18, 2005 6:12 pm
Contact:

Postby w1n78 » Sat May 21, 2005 11:37 pm

thx ruturajv, but my smtp is setup and working correctly. i just want PHP to recognize phpmailer so that all my sites will know where the files are when i add the require_once

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun May 22, 2005 12:00 am

please check php.ini file for

Code: Select all

[mail function]
; For Win32 only.
SMTP = 127.0.0.1

; For Win32 only.
sendmail_from = me@localhost.com

w1n78
New php-forum User
New php-forum User
Posts: 5
Joined: Wed May 18, 2005 6:12 pm
Contact:

Postby w1n78 » Sun May 22, 2005 12:07 am

there's nothing wrong with the mail function or smtp. it's setup and working fine. what i want PHP to do is to recognize phpmailer class. phpmailer is not a builtin class that came with PHP. it's a third party class i downloaded. the instructions told me to edit the php.ini and add the path where phpmailer is in the include_path but it still doesn't work.

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun May 22, 2005 12:17 am

but you MUST do an

Code: Select all

   include 'class.phpmailer.php';

if the file is in your include path, then no need to specify the exact filepath or else you will have to give exact file path

w1n78
New php-forum User
New php-forum User
Posts: 5
Joined: Wed May 18, 2005 6:12 pm
Contact:

Postby w1n78 » Sun May 22, 2005 12:27 am

ya, i ended up copying the phpmailer folder on every site i have and it works. i just wish i can somehow have PHP know where the phpmailer folder is for every site and have it store only in one place.

thanks for the help :D

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Mon May 23, 2005 3:40 am

w1n78 wrote:ya, i ended up copying the phpmailer folder on every site i have and it works. i just wish i can somehow have PHP know where the phpmailer folder is for every site and have it store only in one place.

thanks for the help :D

for that you need to set

Code: Select all

include_path = ".:/usr/local/lib/php:/your/common/scripts/path"


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron