Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Email on XP/Apache OS Commerce


shash

Recommended Posts

Getting Email to Work under OS commerce, local host, Windows XP.

 

 

1. Verify your PHP info

 

OS Commerce uses the MAIL() PHP function that is part of the standard PHP distribution. Mail() is controlled by several settings in the PHP.ini file. To determine the location of the php.ini file, run the phpinfo() function by writing a php script calling this function and placing somewhere in the web directory. Here is the script:

 

<?php phpinfo()

?>

 

On my system, phpinfo() returned?

 

PHP Version 4.3.4

 

System Windows NT NEWSHASH 5.1 build 2600

Build Date Nov 2 2003 23:43:42

Server API Apache

Virtual Directory Support enabled

Configuration File (php.ini) Path c:\program files\apache group\apache\php.ini

PHP API 20020918

PHP Extension 20020429

Zend Extension 20021010

Debug Build no

Thread Safety enabled

Registered PHP Streams php, http, ftp, compress.zlib

 

 

2. Check and/or Modify your php.ini file settings

 

Note the location of the php.ini file from the phpinfo() in the previous section. Edit that file and look for the following section:

 

;;;;;;;;;;;;;;;;;;;

; Module Settings ;

;;;;;;;;;;;;;;;;;;;

 

[syslog]

; Whether or not to define the various syslog variables (e.g. $LOG_PID,

; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In

; runtime, you can define these variables by calling define_syslog_variables().

define_syslog_variables = Off

 

[mail function]

; For Win32 only.

SMTP = ***this should be the name of your smtp server (e.g., mail.myserver.com) ***

 

; For Win32 only.

sendmail_from = ***this should be your email address (e.g., [email protected])***

 

 

 

3. Force Apache to re-read the php.ini file

 

Next you need to restart Apache (or your web server) to force it to re-read the php.ini file and accept the new settings.

 

Now, you can put the following PHP script into your php base directory for testing?

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head><b>Test Mail</b>

</head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<?php

//define('TEST_EMAIL_ACCOUNT', '[email protected]');

define('TEST_EMAIL_ACCOUNT', '[email protected]');

 

//echo TEST_EMAIL_ACCOUNT;

 

if(mail(TEST_EMAIL_ACCOUNT, "TEST EMAIL", "Test Email "))

{

echo"SUCCESS";

}else{

echo"FAILURE";

}

?>

 

 

Run the above script in a PHP visible directory and run it. It should return success.

 

-Shash

Link to comment
Share on other sites

  • 1 year later...
Getting Email to Work under OS commerce, local host, Windows XP.

1. Verify your PHP info

 

OS Commerce uses the MAIL() PHP function that is part of the standard PHP distribution.  Mail() is controlled by several settings in the PHP.ini file.  To determine the location of the php.ini file, run the phpinfo() function by writing a php script calling this function and placing somewhere in the web directory.  Here is the script:

 

<?php phpinfo()

?>

 

On my system, phpinfo() returned?

 

PHP Version 4.3.4

 

System  Windows NT NEWSHASH 5.1 build 2600

Build Date  Nov 2 2003 23:43:42

Server API  Apache

Virtual Directory Support  enabled

Configuration File (php.ini) Path  c:\program files\apache group\apache\php.ini

PHP API  20020918

PHP Extension  20020429

Zend Extension  20021010

Debug Build  no

Thread Safety  enabled

Registered PHP Streams  php, http, ftp, compress.zlib

 

 

2. Check and/or Modify your php.ini file settings

 

Note the location of the php.ini file from the phpinfo() in the previous section.  Edit that file and look for the following section:

 

;;;;;;;;;;;;;;;;;;;

; Module Settings ;

;;;;;;;;;;;;;;;;;;;

 

[syslog]

; Whether or not to define the various syslog variables (e.g. $LOG_PID,

; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In

; runtime, you can define these variables by calling define_syslog_variables().

define_syslog_variables  = Off

 

[mail function]

; For Win32 only.

SMTP = ***this should be the name of your smtp server (e.g., mail.myserver.com) ***

 

; For Win32 only.

sendmail_from = ***this should be your email address (e.g., [email protected])***

3. Force Apache to re-read the php.ini file

 

Next you need to restart Apache (or your web server) to force it to re-read the php.ini file and accept the new settings.

 

Now, you can put the following PHP script into your php base directory for testing?

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head><b>Test Mail</b>

</head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<?php

//define('TEST_EMAIL_ACCOUNT', '[email protected]');

define('TEST_EMAIL_ACCOUNT', '[email protected]');

 

//echo TEST_EMAIL_ACCOUNT;

 

if(mail(TEST_EMAIL_ACCOUNT, "TEST EMAIL", "Test Email "))

{

echo"SUCCESS";

}else{

echo"FAILURE";

}

?>

Run the above script in a PHP visible directory and run it.  It should return success.

 

-Shash

 

Of all the email notes, this one actually has code on it that looks similar to what is going out in every email sent from my website. It looks like this...

 

Sent: None

To: [email protected]; Carol Oehler

Subject: Happy Dance Wholesale Upgrade

 

X-Mailer: osCommerce

 

Content-Type: text/plain; charset="iso-8859-1"

 

Content-Transfer-Encoding: 7bit

 

Message-Id: <[email protected]>

Date: Fri, 8 Jul 2005 16:25:19 -0700 (PDT)

 

Any idea why this stuff would be going out in the emails? I am sure it turns customers away.

Link to comment
Share on other sites

Getting Email to Work under OS commerce, local host, Windows XP

 

Alternatively, make it easy on yourself and download and install the free version of Post Cast Mail Server.

 

Vger

Link to comment
Share on other sites

  • 2 weeks later...

after doing the above all works except there are no sent emails + no errors from oSC,

 

oSC is talking to the smtp server because if i disconnect the wan this occurs:

 

 

//##################

 

 

Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in C:\catalog\includes\classes\class.smtp.inc on line 87

 

Warning: fsockopen(): unable to connect to relay.f9.net.uk:25 in C:\catalog\includes\classes\class.smtp.inc on line 87

 

Warning: Cannot modify header information - headers already sent by (output started at C:\webservices\www\shop\catalog\includes\classes\class.smtp.inc:87) in C:\catalog\includes\functions\general.php on line 29

 

//##################

 

 

Can anyone help please.

Link to comment
Share on other sites

  • 4 months later...

I get this error message after creating account or making order.

 

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in D:\hshome\doddsvil\doddsvillecom.com\catalog\includes\classes\email.php on line 502

 

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in D:\hshome\doddsvil\doddsvillecom.com\catalog\includes\classes\email.php on line 502

 

Warning: Cannot modify header information - headers already sent by (output started at D:\hshome\doddsvil\doddsvillecom.com\catalog\includes\classes\email.php:502) in D:\hshome\doddsvil\doddsvillecom.com\catalog\includes\functions\general.php on line 29

 

Any ideas what to do I have tried to change the php.ini file but can't locate it. the website is being hosted by acomhosting. Can someone please help this newbie out.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...